<!doctype html><html lang="en">
 <head>
  <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  <title>CSS Containment Module Level 2</title>
  <meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport">
  <meta content="stable" name="csswg-work-status">
  <meta content="ED" name="w3c-status">
  <meta content="This CSS module describes the &apos;contain&apos; property, which indicates that the element&apos;s subtree is independent of the rest of the page. This enables heavy optimizations by user agents when used well." name="abstract">
  <link href="../default.css" rel="stylesheet" type="text/css">
  <link href="../csslogo.ico" rel="shortcut icon" type="image/x-icon">
<style>
  body {
    background: url("https://www.w3.org/StyleSheets/TR/logo-ED") top left no-repeat;
  }
  </style>
  <link href="https://www.w3.org/TR/css-contain-2/" rel="canonical">
<style>/* style-md-lists */

/* This is a weird hack for me not yet following the commonmark spec
   regarding paragraph and lists. */
[data-md] > :first-child {
    margin-top: 0;
}
[data-md] > :last-child {
    margin-bottom: 0;
}</style>
<style>/* style-selflinks */

.heading, .issue, .note, .example, li, dt {
    position: relative;
}
a.self-link {
    position: absolute;
    top: 0;
    left: calc(-1 * (3.5rem - 26px));
    width: calc(3.5rem - 26px);
    height: 2em;
    text-align: center;
    border: none;
    transition: opacity .2s;
    opacity: .5;
}
a.self-link:hover {
    opacity: 1;
}
.heading > a.self-link {
    font-size: 83%;
}
li > a.self-link {
    left: calc(-1 * (3.5rem - 26px) - 2em);
}
dfn > a.self-link {
    top: auto;
    left: auto;
    opacity: 0;
    width: 1.5em;
    height: 1.5em;
    background: gray;
    color: white;
    font-style: normal;
    transition: opacity .2s, background-color .2s, color .2s;
}
dfn:hover > a.self-link {
    opacity: 1;
}
dfn > a.self-link:hover {
    color: black;
}

a.self-link::before            { content: "¶"; }
.heading > a.self-link::before { content: "§"; }
dfn > a.self-link::before      { content: "#"; }</style>
<style>/* style-counters */

body {
    counter-reset: example figure issue;
}
.issue {
    counter-increment: issue;
}
.issue:not(.no-marker)::before {
    content: "Issue " counter(issue);
}

.example {
    counter-increment: example;
}
.example:not(.no-marker)::before {
    content: "Example " counter(example);
}
.invalid.example:not(.no-marker)::before,
.illegal.example:not(.no-marker)::before {
    content: "Invalid Example" counter(example);
}

figcaption {
    counter-increment: figure;
}
figcaption:not(.no-marker)::before {
    content: "Figure " counter(figure) " ";
}</style>
<style>/* style-autolinks */

.css.css, .property.property, .descriptor.descriptor {
    color: #005a9c;
    font-size: inherit;
    font-family: inherit;
}
.css::before, .property::before, .descriptor::before {
    content: "‘";
}
.css::after, .property::after, .descriptor::after {
    content: "’";
}
.property, .descriptor {
    /* Don't wrap property and descriptor names */
    white-space: nowrap;
}
.type { /* CSS value <type> */
    font-style: italic;
}
pre .property::before, pre .property::after {
    content: "";
}
[data-link-type="property"]::before,
[data-link-type="propdesc"]::before,
[data-link-type="descriptor"]::before,
[data-link-type="value"]::before,
[data-link-type="function"]::before,
[data-link-type="at-rule"]::before,
[data-link-type="selector"]::before,
[data-link-type="maybe"]::before {
    content: "‘";
}
[data-link-type="property"]::after,
[data-link-type="propdesc"]::after,
[data-link-type="descriptor"]::after,
[data-link-type="value"]::after,
[data-link-type="function"]::after,
[data-link-type="at-rule"]::after,
[data-link-type="selector"]::after,
[data-link-type="maybe"]::after {
    content: "’";
}

[data-link-type].production::before,
[data-link-type].production::after,
.prod [data-link-type]::before,
.prod [data-link-type]::after {
    content: "";
}

[data-link-type=element],
[data-link-type=element-attr] {
    font-family: Menlo, Consolas, "DejaVu Sans Mono", monospace;
    font-size: .9em;
}
[data-link-type=element]::before { content: "<" }
[data-link-type=element]::after  { content: ">" }

[data-link-type=biblio] {
    white-space: pre;
}</style>
<style>/* style-dfn-panel */

.dfn-panel {
    position: absolute;
    z-index: 35;
    height: auto;
    width: -webkit-fit-content;
    width: fit-content;
    max-width: 300px;
    max-height: 500px;
    overflow: auto;
    padding: 0.5em 0.75em;
    font: small Helvetica Neue, sans-serif, Droid Sans Fallback;
    background: #DDDDDD;
    color: black;
    border: outset 0.2em;
}
.dfn-panel:not(.on) { display: none; }
.dfn-panel * { margin: 0; padding: 0; text-indent: 0; }
.dfn-panel > b { display: block; }
.dfn-panel a { color: black; }
.dfn-panel a:not(:hover) { text-decoration: none !important; border-bottom: none !important; }
.dfn-panel > b + b { margin-top: 0.25em; }
.dfn-panel ul { padding: 0; }
.dfn-panel li { list-style: inside; }
.dfn-panel.activated {
    display: inline-block;
    position: fixed;
    left: .5em;
    bottom: 2em;
    margin: 0 auto;
    max-width: calc(100vw - 1.5em - .4em - .5em);
    max-height: 30vh;
}

.dfn-paneled { cursor: pointer; }
</style>
<style>/* style-syntax-highlighting */

.highlight:not(.idl) { background: hsl(24, 20%, 95%); }
code.highlight { padding: .1em; border-radius: .3em; }
pre.highlight, pre > code.highlight { display: block; padding: 1em; margin: .5em 0; overflow: auto; border-radius: 0; }
c-[a] { color: #990055 } /* Keyword.Declaration */
c-[b] { color: #990055 } /* Keyword.Type */
c-[c] { color: #708090 } /* Comment */
c-[d] { color: #708090 } /* Comment.Multiline */
c-[e] { color: #0077aa } /* Name.Attribute */
c-[f] { color: #669900 } /* Name.Tag */
c-[g] { color: #222222 } /* Name.Variable */
c-[k] { color: #990055 } /* Keyword */
c-[l] { color: #000000 } /* Literal */
c-[m] { color: #000000 } /* Literal.Number */
c-[n] { color: #0077aa } /* Name */
c-[o] { color: #999999 } /* Operator */
c-[p] { color: #999999 } /* Punctuation */
c-[s] { color: #a67f59 } /* Literal.String */
c-[t] { color: #a67f59 } /* Literal.String.Single */
c-[u] { color: #a67f59 } /* Literal.String.Double */
c-[cp] { color: #708090 } /* Comment.Preproc */
c-[c1] { color: #708090 } /* Comment.Single */
c-[cs] { color: #708090 } /* Comment.Special */
c-[kc] { color: #990055 } /* Keyword.Constant */
c-[kn] { color: #990055 } /* Keyword.Namespace */
c-[kp] { color: #990055 } /* Keyword.Pseudo */
c-[kr] { color: #990055 } /* Keyword.Reserved */
c-[ld] { color: #000000 } /* Literal.Date */
c-[nc] { color: #0077aa } /* Name.Class */
c-[no] { color: #0077aa } /* Name.Constant */
c-[nd] { color: #0077aa } /* Name.Decorator */
c-[ni] { color: #0077aa } /* Name.Entity */
c-[ne] { color: #0077aa } /* Name.Exception */
c-[nf] { color: #0077aa } /* Name.Function */
c-[nl] { color: #0077aa } /* Name.Label */
c-[nn] { color: #0077aa } /* Name.Namespace */
c-[py] { color: #0077aa } /* Name.Property */
c-[ow] { color: #999999 } /* Operator.Word */
c-[mb] { color: #000000 } /* Literal.Number.Bin */
c-[mf] { color: #000000 } /* Literal.Number.Float */
c-[mh] { color: #000000 } /* Literal.Number.Hex */
c-[mi] { color: #000000 } /* Literal.Number.Integer */
c-[mo] { color: #000000 } /* Literal.Number.Oct */
c-[sb] { color: #a67f59 } /* Literal.String.Backtick */
c-[sc] { color: #a67f59 } /* Literal.String.Char */
c-[sd] { color: #a67f59 } /* Literal.String.Doc */
c-[se] { color: #a67f59 } /* Literal.String.Escape */
c-[sh] { color: #a67f59 } /* Literal.String.Heredoc */
c-[si] { color: #a67f59 } /* Literal.String.Interpol */
c-[sx] { color: #a67f59 } /* Literal.String.Other */
c-[sr] { color: #a67f59 } /* Literal.String.Regex */
c-[ss] { color: #a67f59 } /* Literal.String.Symbol */
c-[vc] { color: #0077aa } /* Name.Variable.Class */
c-[vg] { color: #0077aa } /* Name.Variable.Global */
c-[vi] { color: #0077aa } /* Name.Variable.Instance */
c-[il] { color: #000000 } /* Literal.Number.Integer.Long */
</style>
<style>/* style-wpt */

.wpt-tests-block {
	list-style: none;
	border-left: .5em solid hsl(290, 70%, 60%);
	background: hsl(290, 70%, 95%);
	margin: 1em auto;
	padding: .5em;
	display: grid;
	grid-template-columns: 1fr auto auto;
	grid-column-gap: .5em;
}
.wpt-tests-block::before {
	content: "Tests";
	grid-column: 1/-1;
	color: hsl(290, 70%, 30%);
	text-transform: uppercase;
}
.wpt-test {
	display: contents;
}
.wpt-test > a {
	text-decoration: underline;
	border: none;
}
</style>
 <body class="h-entry">
  <div class="head">
   <p data-fill-with="logo"><a class="logo" href="https://www.w3.org/"> <img alt="W3C" height="48" src="https://www.w3.org/StyleSheets/TR/2016/logos/W3C" width="72"> </a> </p>
   <h1 class="p-name no-ref" id="title">CSS Containment Module Level 2</h1>
   <h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Editor’s Draft, <time class="dt-updated" datetime="1970-01-01">1 January 1970</time></span></h2>
   <details>
    <summary>Specification Metadata</summary>
    <div data-fill-with="spec-metadata">
     <dl>
      <dt>This version:
      <dd><a class="u-url" href="https://drafts.csswg.org/css-contain-2/">https://drafts.csswg.org/css-contain-2/</a>
      <dt>Latest published version:
      <dd><a href="https://www.w3.org/TR/css-contain-2/">https://www.w3.org/TR/css-contain-2/</a>
      <dt>Previous Versions:
      <dd><a href="https://www.w3.org/TR/2019/WD-css-contain-2-20191015/" rel="prev">https://www.w3.org/TR/2019/WD-css-contain-2-20191015/</a>
      <dt>Test Suite:
      <dd><a href="https://test.csswg.org/harness/results/css-contain-1_dev/">https://test.csswg.org/harness/results/css-contain-1_dev/</a>
      <dt class="editor">Editors:
      <dd class="editor p-author h-card vcard" data-editor-id="42199"><a class="p-name fn u-url url" href="http://xanthir.com/contact/">Tab Atkins</a> (<span class="p-org org">Google</span>)
      <dd class="editor p-author h-card vcard" data-editor-id="43241"><a class="p-name fn u-url url" href="https://florian.rivoal.net/">Florian Rivoal</a> (<span class="p-org org">On behalf of Bloomberg</span>)
      <dt>Suggest an Edit for this Spec:
      <dd><a href="https://github.com/w3c/csswg-drafts/blob/master/css-contain-2/Overview.bs">GitHub Editor</a>
      <dt>Issue Tracking:
      <dd><a href="https://github.com/w3c/csswg-drafts/labels/css-contain-2">GitHub Issues</a>
     </dl>
    </div>
   </details>
   <div data-fill-with="warning"></div>
   <p class="copyright" data-fill-with="copyright"><a href="https://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 1970 <a href="https://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a href="https://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>, <a href="https://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>, <a href="https://www.keio.ac.jp/">Keio</a>, <a href="https://ev.buaa.edu.cn/">Beihang</a>). W3C <a href="https://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href="https://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and <a href="https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document">permissive document license</a> rules apply. </p>
   <hr title="Separator for header">
  </div>
  <div class="p-summary" data-fill-with="abstract">
   <h2 class="no-num no-toc no-ref heading settled" id="abstract"><span class="content">Abstract</span></h2>
   <p>This CSS module describes the <a class="property" data-link-type="propdesc" href="#propdef-contain" id="ref-for-propdef-contain">contain</a> property, which indicates that the element’s subtree is independent of the rest of the page. This enables heavy optimizations by user agents when used well.</p>
    <a href="https://www.w3.org/TR/CSS/">CSS</a> is a language for describing the rendering of structured documents
(such as HTML and XML)
on screen, on paper, etc. 
  </div>
  <h2 class="no-num no-toc no-ref heading settled" id="status"><span class="content">Status of this document</span></h2>
  <div data-fill-with="status">
   <p> This is a public copy of the editors’ draft.
	It is provided for discussion only and may change at any moment.
	Its publication here does not imply endorsement of its contents by W3C.
	Don’t cite this document other than as work in progress. </p>
   <p> <a href="https://github.com/w3c/csswg-drafts/issues">GitHub Issues</a> are preferred for discussion of this specification.
	When filing an issue, please put the text “css-contain” in the title,
	preferably like this:
	“[css-contain] <i data-lt>…summary of comment…</i>”.
	All issues and comments are <a href="https://lists.w3.org/Archives/Public/public-css-archive/">archived</a>,
	and there is also a <a href="https://lists.w3.org/Archives/Public/www-style/">historical archive</a>. </p>
   <p> This document was produced by the <a href="https://www.w3.org/Style/CSS/">CSS Working Group</a>. </p>
   <p> This document was produced by a group operating under
	the <a href="https://www.w3.org/Consortium/Patent-Policy/">W3C Patent Policy</a>.
	W3C maintains a <a href="https://www.w3.org/2004/01/pp-impl/32061/status" rel="disclosure">public list of any patent disclosures</a> made in connection with the deliverables of the group;
	that page also includes instructions for disclosing a patent.
	An individual who has actual knowledge of a patent which the individual believes contains <a href="https://www.w3.org/Consortium/Patent-Policy/#def-essential">Essential Claim(s)</a> must disclose the information in accordance with <a href="https://www.w3.org/Consortium/Patent-Policy/#sec-Disclosure">section 6 of the W3C Patent Policy</a>. </p>
   <p> This document is governed by the <a href="https://www.w3.org/2019/Process-20190301/" id="w3c_process_revision">1 March 2019 W3C Process Document</a>. </p>
   <p></p>
  </div>
  <div data-fill-with="at-risk">
   <p>The following features are at-risk, and may be dropped during the CR period: </p>
   <ul>
    <li><a data-link-type="dfn" href="#style-containment" id="ref-for-style-containment">style containment</a> and the <a class="css" data-link-type="propdesc" href="#propdef-contain" id="ref-for-propdef-contain①">contain: style</a> value
   </ul>
   <p>“At-risk” is a W3C Process term-of-art, and does not necessarily imply that the feature is in danger of being dropped or delayed. It means that the WG believes the feature may have difficulty being interoperably implemented in a timely manner, and marking it as such allows the WG to drop the feature if necessary when transitioning to the Proposed Rec stage, without having to publish a new Candidate Rec without the feature first.</p>
  </div>
  <nav data-fill-with="table-of-contents" id="toc">
   <h2 class="no-num no-toc no-ref" id="contents">Table of Contents</h2>
   <ol class="toc" role="directory">
    <li>
     <a href="#intro"><span class="secno">1</span> <span class="content"> Introduction</span></a>
     <ol class="toc">
      <li><a href="#interaction"><span class="secno">1.1</span> <span class="content"> Module Interactions</span></a>
      <li><a href="#values"><span class="secno">1.2</span> <span class="content"> Values</span></a>
     </ol>
    <li><a href="#contain-property"><span class="secno">2</span> <span class="content"> Strong Containment: the <span class="property">contain</span> property</span></a>
    <li>
     <a href="#containment-types"><span class="secno">3</span> <span class="content"> Types of Containment</span></a>
     <ol class="toc">
      <li><a href="#containment-size"><span class="secno">3.1</span> <span class="content"> Size Containment</span></a>
      <li><a href="#containment-layout"><span class="secno">3.2</span> <span class="content"> Layout Containment</span></a>
      <li><a href="#containment-style"><span class="secno">3.3</span> <span class="content"> Style Containment</span></a>
      <li><a href="#containment-paint"><span class="secno">3.4</span> <span class="content"> Paint Containment</span></a>
     </ol>
    <li><a href="#privsec"><span class="secno">4</span> <span class="content">Privacy and Security Considerations</span></a>
    <li>
     <a href="#changes"><span class="secno"></span> <span class="content">Appendix A. Changes</span></a>
     <ol class="toc">
      <li><a href="#l1-changes"><span class="secno"></span> <span class="content"> Changes from <span>CSS Containment Level 1</span> </span></a>
     </ol>
    <li>
     <a href="#conformance"><span class="secno"></span> <span class="content"> Conformance</span></a>
     <ol class="toc">
      <li><a href="#document-conventions"><span class="secno"></span> <span class="content"> Document conventions</span></a>
      <li><a href="#conform-classes"><span class="secno"></span> <span class="content"> Conformance classes</span></a>
      <li>
       <a href="#conform-responsible"><span class="secno"></span> <span class="content"> Requirements for Responsible Implementation of CSS</span></a>
       <ol class="toc">
        <li><a href="#conform-partial"><span class="secno"></span> <span class="content"> Partial Implementations</span></a>
        <li><a href="#conform-future-proofing"><span class="secno"></span> <span class="content"> Implementations of Unstable and Proprietary Features</span></a>
        <li><a href="#conform-testing"><span class="secno"></span> <span class="content"> Implementations of CR-level Features</span></a>
       </ol>
     </ol>
    <li>
     <a href="#index"><span class="secno"></span> <span class="content">Index</span></a>
     <ol class="toc">
      <li><a href="#index-defined-here"><span class="secno"></span> <span class="content">Terms defined by this specification</span></a>
      <li><a href="#index-defined-elsewhere"><span class="secno"></span> <span class="content">Terms defined by reference</span></a>
     </ol>
    <li>
     <a href="#references"><span class="secno"></span> <span class="content">References</span></a>
     <ol class="toc">
      <li><a href="#normative"><span class="secno"></span> <span class="content">Normative References</span></a>
      <li><a href="#informative"><span class="secno"></span> <span class="content">Informative References</span></a>
     </ol>
    <li><a href="#property-index"><span class="secno"></span> <span class="content">Property Index</span></a>
   </ol>
  </nav>
  <main>
   <h2 class="heading settled" data-level="1" id="intro"><span class="secno">1. </span><span class="content"> Introduction</span><a class="self-link" href="#intro"></a></h2>
   <p>Efficiently rendering a website relies on the User Agent being able to detect what parts of the page are being displayed,
	which parts might affect the currently-displayed section,
	and what can be ignored.</p>
   <p>There are various heuristics that can be used to guess when a given sub-tree is independent of the rest of the page in some manner,
	but they’re fragile,
	so innocuous changes to a page may inadvertently make it fail such heuristic tests,
	causing rendering to fall into a slow code path.
	There are also many things that would be good to isolate which are difficult or impossible to detect in a heuristic manner.</p>
   <p>To alleviate these problems
	and allow strong, predictable isolation of a subtree from the rest of the page,
	this specification defines a <a class="property" data-link-type="propdesc" href="#propdef-contain" id="ref-for-propdef-contain②">contain</a> property.</p>
   <h3 class="heading settled" data-level="1.1" id="interaction"><span class="secno">1.1. </span><span class="content"> Module Interactions</span><a class="self-link" href="#interaction"></a></h3>
   <p>This document defines new features not present in earlier specifications.
	In addition, it aims to replace and supersede <a data-link-type="biblio" href="#biblio-css-contain-1">[CSS-CONTAIN-1]</a> once stable.</p>
   <h3 class="heading settled" data-level="1.2" id="values"><span class="secno">1.2. </span><span class="content"> Values</span><a class="self-link" href="#values"></a></h3>
   <p>This specification follows
	the <a href="https://www.w3.org/TR/CSS2/about.html#property-defs">CSS property definition conventions</a> from <a data-link-type="biblio" href="#biblio-css2">[CSS2]</a>.
	Value types not defined in this specification are defined in CSS Values &amp; Units <a data-link-type="biblio" href="#biblio-css-values-3">[CSS-VALUES-3]</a>.
	Other CSS modules may expand the definitions of these value types.</p>
   <p>In addition to the property-specific values listed in their definitions,
	all properties defined in this specification
	also accept the <a data-link-type="dfn" href="https://drafts.csswg.org/css-values-4/#css-wide-keywords" id="ref-for-css-wide-keywords">CSS-wide keywords</a> keywords as their property value.
	For readability they have not been repeated explicitly.</p>
   <h2 class="heading settled" data-level="2" id="contain-property"><span class="secno">2. </span><span class="content"> Strong Containment: the <a class="property" data-link-type="propdesc" href="#propdef-contain" id="ref-for-propdef-contain③">contain</a> property</span><a class="self-link" href="#contain-property"></a></h2>
   <table class="def propdef" data-link-for-hint="contain">
    <tbody>
     <tr>
      <th>Name:
      <td><dfn class="dfn-paneled css" data-dfn-type="property" data-export id="propdef-contain">contain</dfn>
     <tr class="value">
      <th><a href="https://drafts.csswg.org/css-values/#value-defs">Value:</a>
      <td class="prod">none <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one">|</a> strict <span id="ref-for-comb-one①">|</span> content <span id="ref-for-comb-one②">|</span> [ size <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-any" id="ref-for-comb-any">||</a> layout <span id="ref-for-comb-any①">||</span> style <span id="ref-for-comb-any②">||</span> paint ] 
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#initial-values">Initial:</a>
      <td>none 
     <tr>
      <th>Applies to:
      <td>See <a href="#contain-applies">below</a> 
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#inherited-property">Inherited:</a>
      <td>no 
     <tr>
      <th><a href="https://drafts.csswg.org/css-values/#percentages">Percentages:</a>
      <td>n/a 
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#computed">Computed value:</a>
      <td>specified keyword(s) 
     <tr>
      <th>Canonical order:
      <td>per grammar 
     <tr>
      <th><a href="https://drafts.csswg.org/web-animations/#animation-type">Animation type:</a>
      <td>not animatable 
   </table>
   <p class="all-media">User Agents are expected to support this property on all media, including non-visual ones.</p>
   <p>The <a class="property" data-link-type="propdesc" href="#propdef-contain" id="ref-for-propdef-contain④">contain</a> property allows an author to indicate that an element and its contents are,
	as much as possible, <em>independent</em> of the rest of the document tree.
	This allows user agents to utilize much stronger optimizations when rendering a page using <span class="property" id="ref-for-propdef-contain⑤">contain</span> properly,
	and allows authors to be confident that their page won’t accidentally fall into a slow code path
	due to an innocuous change.</p>
   <dl>
    <dt><dfn class="css" data-dfn-for="contain" data-dfn-type="value" data-export id="valdef-contain-none">none<a class="self-link" href="#valdef-contain-none"></a></dfn> 
    <dd> This value indicates that the property has no effect.
			The element renders as normal,
			with no containment effects applied. 
    <dt><dfn class="css" data-dfn-for="contain" data-dfn-type="value" data-export id="valdef-contain-strict">strict<a class="self-link" href="#valdef-contain-strict"></a></dfn> 
    <dd> This value turns on all forms of <a data-link-type="dfn" href="#containment" id="ref-for-containment">containment</a> <em>except</em> <a data-link-type="dfn" href="#style-containment" id="ref-for-style-containment①">style containment</a> for the element.
			In other words, it behaves the same as <a class="css" data-link-type="propdesc" href="#propdef-contain" id="ref-for-propdef-contain⑥">contain: size layout paint;</a>. 
    <dt><dfn class="css" data-dfn-for="contain" data-dfn-type="value" data-export id="valdef-contain-content">content<a class="self-link" href="#valdef-contain-content"></a></dfn> 
    <dd>
      This value turns on all forms of <a data-link-type="dfn" href="#containment" id="ref-for-containment①">containment</a> <em>except</em> <a data-link-type="dfn" href="#size-containment" id="ref-for-size-containment">size containment</a> and <a data-link-type="dfn" href="#style-containment" id="ref-for-style-containment②">style containment</a> for the element.
			In other words, it behaves the same as <a class="css" data-link-type="propdesc" href="#propdef-contain" id="ref-for-propdef-contain⑦">contain: layout paint;</a>. 
     <p class="note" role="note"><span>Note:</span> <a class="css" data-link-type="propdesc" href="#propdef-contain" id="ref-for-propdef-contain⑧">contain: content</a> is reasonably "safe" to apply widely;
			its effects are fairly minor in practice,
			and most content won’t run afoul of its restrictions.
			However, because it doesn’t apply <a data-link-type="dfn" href="#size-containment" id="ref-for-size-containment①">size containment</a>,
			the element can still respond to the size of its contents,
			which can cause layout-invalidation to percolate further up the tree than desired.
			Use <span class="css" id="ref-for-propdef-contain⑨">contain: strict</span> or <span class="css" id="ref-for-propdef-contain①⓪">contain: strict style</span> when possible,
			to gain as much containment as you can.</p>
    <dt><dfn class="css" data-dfn-for="contain" data-dfn-type="value" data-export id="valdef-contain-size">size<a class="self-link" href="#valdef-contain-size"></a></dfn> 
    <dd> The value turns on <a data-link-type="dfn" href="#size-containment" id="ref-for-size-containment②">size containment</a> for the element.
			This ensures that the containing box can be laid out
			without needing to examine its descendants. 
    <dt><dfn class="css" data-dfn-for="contain" data-dfn-type="value" data-export id="valdef-contain-layout">layout<a class="self-link" href="#valdef-contain-layout"></a></dfn> 
    <dd> This value turns on <a data-link-type="dfn" href="#layout-containment" id="ref-for-layout-containment">layout containment</a> for the element.
			This ensures that the containing box is <em>totally opaque</em> for layout purposes;
			nothing outside can affect its internal layout,
			and vice versa. 
    <dt><dfn class="css" data-dfn-for="contain" data-dfn-type="value" data-export id="valdef-contain-style">style<a class="self-link" href="#valdef-contain-style"></a></dfn> 
    <dd>
      This value turns on <a data-link-type="dfn" href="#style-containment" id="ref-for-style-containment③">style containment</a> for the element.
			This ensures that,
			for properties which can have effects on more than just an element and its descendants,
			those effects don’t escape the element. 
     <p class="note" role="note"><span>Note:</span> This value is at-risk.</p>
    <dt><dfn class="css" data-dfn-for="contain" data-dfn-type="value" data-export id="valdef-contain-paint">paint<a class="self-link" href="#valdef-contain-paint"></a></dfn> 
    <dd> This value turns on <a data-link-type="dfn" href="#paint-containment" id="ref-for-paint-containment">paint containment</a> for the element.
			This ensures that the descendants of the containing box don’t display outside its bounds,
			so if an element is off-screen or otherwise not visible,
			its descendants are also guaranteed to be not visible. 
   </dl>
   <p><span id="contain-applies">This property generally applies to all elements (including <a href="https://www.w3.org/TR/css-pseudo-4/#generated-content">CSS Pseudo-Elements 4 §4.1 Generated Content Pseudo-elements: ::before and ::after</a>)</span>,
	although some types of containment have no effect on some elements,
	as detailed in <a href="#containment-types">§ 3 Types of Containment</a>.
	In addition, in the case of <a data-link-type="biblio" href="#biblio-svg2">[SVG2]</a>,
	the <a class="property" data-link-type="propdesc" href="#propdef-contain" id="ref-for-propdef-contain①①">contain</a> property only applies to <code><a data-link-type="element" href="https://svgwg.org/svg2-draft/struct.html#elementdef-svg" id="ref-for-elementdef-svg">svg</a></code> elements that have an associated CSS layout box.</p>
   <div class="example" id="example-ace3db03">
    <a class="self-link" href="#example-ace3db03"></a> <a class="property" data-link-type="propdesc" href="#propdef-contain" id="ref-for-propdef-contain①②">contain</a> is useful when used widely on a page,
		particularly when a page contains a lot of "widgets" which are all independent. 
    <p>For example, assume a micropost social network had markup something like this:</p>
<pre><code class="highlight"><c- p>&lt;</c-><c- f>body</c-><c- p>></c->
  <c- p>&lt;</c-><c- f>aside</c-><c- p>></c->...<c- p>&lt;/</c-><c- f>aside</c-><c- p>></c->
  <c- p>&lt;</c-><c- f>section</c-><c- p>></c->
    <c- p>&lt;</c-><c- f>h2</c-><c- p>></c->Messages<c- p>&lt;/</c-><c- f>h2</c-><c- p>></c->
    <c- p>&lt;</c-><c- f>article</c-><c- p>></c->
      Lol, check out this dog: images.example.com/jsK3jkl
    <c- p>&lt;/</c-><c- f>article</c-><c- p>></c->
    <c- p>&lt;</c-><c- f>article</c-><c- p>></c->
      I had a ham sandwich today. #goodtimes
    <c- p>&lt;/</c-><c- f>article</c-><c- p>></c->
    <c- p>&lt;</c-><c- f>article</c-><c- p>></c->
      I have political opinions that you need to hear!
    <c- p>&lt;/</c-><c- f>article</c-><c- p>></c->
    …
  <c- p>&lt;/</c-><c- f>section</c-><c- p>></c->
<c- p>&lt;/</c-><c- f>body</c-><c- p>></c->
</code></pre>
    <p>There are probably a <em>lot</em> of messages displayed on the site,
		but each is independent and won’t affect anything else on the site.
		As such, each can be marked with <a class="css" data-link-type="propdesc" href="#propdef-contain" id="ref-for-propdef-contain①③">contain: content</a> to communicate this to the user agent,
		so it can optimize the page and skip a lot of computation for messages that are off-screen.
		If the size of each message is known ahead of time, <span class="css" id="ref-for-propdef-contain①④">contain: strict</span> can be applied to communicate further restrictions.</p>
   </div>
   <h2 class="heading settled" data-level="3" id="containment-types"><span class="secno">3. </span><span class="content"> Types of Containment</span><a class="self-link" href="#containment-types"></a></h2>
   <p>There are several varieties of <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="containment">containment</dfn> that an element can be subject to,
	restricting the effects that its descendants can have on the rest of the page in various ways. <a data-link-type="dfn" href="#containment" id="ref-for-containment②">Containment</a> enables much more powerful optimizations by user agents,
	and helps authors compose their page out of functional units,
	as it limits how widely a given change can affect a document.</p>
   <p><strong class="advisement"> Specification authors introducing new properties or mechanisms
	need to consider whether and how the various types of containment
	affect what they are introducing,
	and include in their specification any effect not described here.</strong></p>
   <h3 class="heading settled" data-level="3.1" id="containment-size"><span class="secno">3.1. </span><span class="content"> Size Containment</span><a class="self-link" href="#containment-size"></a></h3>
   <p>If the element does not generate a <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#principal-box" id="ref-for-principal-box">principal box</a> (as is the case with <a class="css" data-link-type="propdesc" href="https://drafts.csswg.org/css-display-3/#propdef-display" id="ref-for-propdef-display">display: contents</a> or <span class="css" id="ref-for-propdef-display①">display: none</span>),
	or its <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#inner-display-type" id="ref-for-inner-display-type">inner display type</a> is <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-display-3/#valdef-display-table" id="ref-for-valdef-display-table">table</a>,
	or its principal box is an <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#internal-table-box" id="ref-for-internal-table-box">internal table box</a>,
	or an <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#internal-ruby-box" id="ref-for-internal-ruby-box">internal ruby box</a>,
	or a <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#atomic-inline" id="ref-for-atomic-inline">non-atomic</a> <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#inline-level" id="ref-for-inline-level">inline-level</a> box,
	size containment has no effect.
	Otherwise, giving an element <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="size-containment">size containment</dfn> makes its <span id="ref-for-principal-box①">principal box</span> a <dfn class="dfn-paneled" data-dfn-for="size-containment" data-dfn-type="dfn" data-noexport id="size-containment-containing-box">containing box</dfn> for <a data-link-type="dfn" href="#size-containment" id="ref-for-size-containment③">size containment</a> and has the following effects:</p>
   <p class="note" role="note"><span>Note:</span> Internal table boxes,
	which do not include table captions,
	are excluded,
	because the table layout algorithm
	does not allow boxes to become smaller than their inflow content.
	Sizing a table cell as if it was empty and then layout out its content inside without changing the size
	is effectively an undefined operation.
	Manually setting the <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-width" id="ref-for-propdef-width">width</a> or <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-height" id="ref-for-propdef-height">height</a> properties to <span class="css">0</span> cannot make it smaller than its content.
	This concern does not apply to table captions,
	which are perfectly capable of having a fixed size
	that is independent of their content.</p>
   <ol>
    <li data-md>
     <p>When calculating the size of the <a data-link-type="dfn" href="#size-containment-containing-box" id="ref-for-size-containment-containing-box">containing box</a>,
it must be treated as having no contents.</p>
     <p class="note" role="note"><span>Note:</span> Even when the element’s <a data-link-type="dfn" href="https://drafts.csswg.org/css-sizing-3/#sizing-property" id="ref-for-sizing-property">sizing properties</a> are <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-sizing-3/#valdef-width-auto" id="ref-for-valdef-width-auto">auto</a> this does not necessarily make the element zero-sized:
properties set on the element itself,
such as the <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-multicol-1/#propdef-columns" id="ref-for-propdef-columns">columns</a> property or the <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-grid-1/#propdef-grid" id="ref-for-propdef-grid">grid</a> property,
continue to be taken into account.</p>
     <p>Then,
its contents must then be laid out into the <a data-link-type="dfn" href="#size-containment-containing-box" id="ref-for-size-containment-containing-box①">containing box</a>'s resolved size.</p>
     <p class="note" role="note"><span>Note:</span> <a data-link-type="dfn" href="#size-containment" id="ref-for-size-containment④">size containment</a> does not suppress baseline alignment.
See <a data-link-type="dfn" href="#layout-containment" id="ref-for-layout-containment①">layout containment</a> for that.</p>
     <p><a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#replaced-element" id="ref-for-replaced-element">Replaced elements</a> must be treated as having an intrinsic width and height of 0.</p>
    <li data-md>
     <p><a data-link-type="dfn" href="#size-containment-containing-box" id="ref-for-size-containment-containing-box②">Containing boxes</a> for <a data-link-type="dfn" href="#size-containment" id="ref-for-size-containment⑤">size containment</a> are <a data-link-type="dfn" href="https://drafts.csswg.org/css-break-3/#monolithic" id="ref-for-monolithic">monolithic</a> (See <a href="https://www.w3.org/TR/css3-break/#possible-breaks">CSS Fragmentation 3 §4.1 Possible Break Points</a>).</p>
   </ol>
   <p>By itself, <a data-link-type="dfn" href="#size-containment" id="ref-for-size-containment⑥">size containment</a> does not offer much optimization opportunity.
	Its primary benefit on its own is that tools which want to lay out the containing box’s contents
	based on the containing box’s size
	(such as a JS library implementing the "container query" concept)
	can do so without fear of "infinite loops",
	where having a child’s size respond to the size of the containing box
	causes the containing box’s size to change as well,
	possibly triggering <em>further</em> changes in how the child sizes itself
	and possibly thus more changes to the containing box’s size,
	ad infinitum.</p>
   <p>When paired with <a data-link-type="dfn" href="#layout-containment" id="ref-for-layout-containment②">layout containment</a>, though,
	possible optimizations that can be enabled include (but are not limited to):</p>
   <ol>
    <li data-md>
     <p>When the style or contents of a descendant of the containing box is changed,
calculating what part of the DOM tree is "dirtied" and might need to be re-laid out
can stop at the containing box.</p>
    <li data-md>
     <p>When laying out the page,
if the containing box is off-screen or obscured,
the layout of its contents can be delayed or done at a lower priority.</p>
   </ol>
   <h3 class="heading settled" data-level="3.2" id="containment-layout"><span class="secno">3.2. </span><span class="content"> Layout Containment</span><a class="self-link" href="#containment-layout"></a></h3>
   <p>If the element does not generate a <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#principal-box" id="ref-for-principal-box②">principal box</a> (as is the case with <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-display-3/#propdef-display" id="ref-for-propdef-display②">display</a> values of <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-display-3/#valdef-display-contents" id="ref-for-valdef-display-contents">contents</a> or <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-display-3/#valdef-display-none" id="ref-for-valdef-display-none">none</a>),
	or its <span id="ref-for-principal-box③">principal box</span> is an <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#internal-table-box" id="ref-for-internal-table-box①">internal table box</a> other than <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-display-3/#valdef-display-table-cell" id="ref-for-valdef-display-table-cell">table-cell</a>,
	or an <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#internal-ruby-box" id="ref-for-internal-ruby-box①">internal ruby box</a>,
	or a <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#atomic-inline" id="ref-for-atomic-inline①">non-atomic</a> <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#inline-level" id="ref-for-inline-level①">inline-level</a> box,
	layout containment has no effect.
	Otherwise, giving an element <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="layout-containment">layout containment</dfn> makes its <span id="ref-for-principal-box④">principal box</span> a <dfn class="dfn-paneled" data-dfn-for="layout-containment" data-dfn-type="dfn" data-noexport id="layout-containment-containing-box">containing box</dfn> for <a data-link-type="dfn" href="#layout-containment" id="ref-for-layout-containment③">layout containment</a> and has the following effects:</p>
   <ol>
    <li data-md>
     <p>The <a data-link-type="dfn" href="#layout-containment-containing-box" id="ref-for-layout-containment-containing-box">containing box</a> <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#establish-an-independent-formatting-context" id="ref-for-establish-an-independent-formatting-context">establishes an independent formatting context</a>.</p>
    <li data-md>
     <p>If at least one <a data-link-type="dfn" href="https://drafts.csswg.org/css-break-3/#fragmentation-container" id="ref-for-fragmentation-container">fragmentation container</a> of a <a data-link-type="dfn" href="https://drafts.csswg.org/css-break-3/#fragmentation-context" id="ref-for-fragmentation-context">fragmentation context</a> has <a data-link-type="dfn" href="#layout-containment" id="ref-for-layout-containment④">layout containment</a>,
or if at least one <span id="ref-for-fragmentation-container①">fragmentation container</span> of a <span id="ref-for-fragmentation-context①">fragmentation context</span> is a descendant of <a data-link-type="dfn" href="#layout-containment-containing-box" id="ref-for-layout-containment-containing-box①">containing box</a> for layout containment <strong>and</strong> at least one subsequent <span id="ref-for-fragmentation-container②">fragmentation container</span> of the same <span id="ref-for-fragmentation-context②">fragmentation context</span> is not a descendant of that same element with layout containment,
then the first <span id="ref-for-layout-containment-containing-box②">containing box</span> for <span id="ref-for-layout-containment⑤">layout containment</span> which is either a <span id="ref-for-fragmentation-container③">fragmentation container</span> itself
or is an ancestor of a <span id="ref-for-fragmentation-container④">fragmentation container</span> must “trap” the remainder of the <a data-link-type="dfn" href="https://drafts.csswg.org/css-break-3/#fragmented-flow" id="ref-for-fragmented-flow">fragmented flow</a>: <a data-link-type="dfn" href="https://drafts.csswg.org/css-break-3/#fragmentation" id="ref-for-fragmentation">fragmentation</a> must not continue past the <span id="ref-for-layout-containment⑥">layout containment</span> boundary,
and the last <span id="ref-for-fragmentation-container⑤">fragmentation container</span> within the first <span id="ref-for-layout-containment⑦">layout containment</span> boundary
is treated as if it is the last <span id="ref-for-fragmentation-container⑥">fragmentation container</span> in its <span id="ref-for-fragmentation-context③">fragmentation context</span>.</p>
     <p>If subsequent <a data-link-type="dfn" href="https://drafts.csswg.org/css-break-3/#fragmentation-container" id="ref-for-fragmentation-container⑦">fragmentation containers</a> in the <a data-link-type="dfn" href="https://drafts.csswg.org/css-break-3/#fragmentation-context" id="ref-for-fragmentation-context④">fragmentation context</a> are only generated when more content remains in the <a data-link-type="dfn" href="https://drafts.csswg.org/css-break-3/#fragmented-flow" id="ref-for-fragmented-flow①">fragmented flow</a>,
then they are not generated.
If they would exist regardless,
they remain part of the <span id="ref-for-fragmentation-context⑤">fragmentation context</span>,
but do not receive any content from the <span id="ref-for-fragmented-flow②">fragmented flow</span>.</p>
     <p class="note" role="note"><span>Note:</span> At the time of writing, no stable specification is affected by this point.
Only specifications that would enable some (but not all) fragmentation containers of a fragmentation context
to be layout-contained (or descendants of a layout contained element)
are concerned.
This is not the case of <a data-link-type="biblio" href="#biblio-css-page-3">[CSS-PAGE-3]</a> nor of <a data-link-type="biblio" href="#biblio-css-multicol-1">[CSS-MULTICOL-1]</a>.
This requirement is nonetheless included because
several mechanisms that would make this a possibility have been considered
(e.g.: <a data-link-type="biblio" href="#biblio-css-regions-1">[CSS-REGIONS-1]</a>, <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-overflow-4/#selectordef-nth-fragment" id="ref-for-selectordef-nth-fragment">::nth-fragment()</a>, a hypothetical selector for individual columns of a multicol…),
and the guarantees that layout containment is intended to offer would not be realized
if such mechanisms did not abide by this rule. <span>[CSS-REGIONS-1]</span> has details over how <a data-link-type="dfn" href="#layout-containment" id="ref-for-layout-containment⑧">layout containment</a> affects
regions.</p>
     <div class="example" id="example-328aa2be">
      <a class="self-link" href="#example-328aa2be"></a> 
<pre><code class="highlight"><c- p>&lt;</c-><c- f>article</c-><c- p>></c->Lorem ipsum…<c- p>&lt;/</c-><c- f>article</c-><c- p>></c->
<c- p>&lt;</c-><c- f>div</c-> <c- e>id</c-><c- o>=</c-><c- s>a</c-><c- p>>&lt;/</c-><c- f>div</c-><c- p>></c->
<c- p>&lt;</c-><c- f>aside</c-><c- p>></c->
  <c- p>&lt;</c-><c- f>div</c-> <c- e>id</c-><c- o>=</c-><c- s>b</c-><c- p>>&lt;/</c-><c- f>div</c-><c- p>></c->
  <c- p>&lt;</c-><c- f>div</c-> <c- e>id</c-><c- o>=</c-><c- s>c</c-><c- p>>&lt;/</c-><c- f>div</c-><c- p>></c->
<c- p>&lt;/</c-><c- f>aside</c-><c- p>></c->
<c- p>&lt;</c-><c- f>aside</c-><c- p>></c->
  <c- p>&lt;</c-><c- f>div</c-> <c- e>id</c-><c- o>=</c-><c- s>d</c-><c- p>>&lt;/</c-><c- f>div</c-><c- p>></c->
  <c- p>&lt;</c-><c- f>div</c-> <c- e>id</c-><c- o>=</c-><c- s>e</c-><c- p>>&lt;/</c-><c- f>div</c-><c- p>></c->
<c- p>&lt;/</c-><c- f>aside</c-><c- p>></c->
<c- p>&lt;</c-><c- f>div</c-> <c- e>id</c-><c- o>=</c-><c- s>f</c-><c- p>>&lt;/</c-><c- f>div</c-><c- p>></c->
</code></pre>
<pre><code class="highlight"><c- f>article </c-><c- p>{</c-><c- k>flow-into</c-><c- p>:</c-> foo<c- p>;}</c->
<c- f>#a, #b, #c, #d, #e, #f </c-><c- p>{</c-><c- k>flow-from</c-><c- p>:</c-> foo<c- p>;}</c->
<c- f>aside </c-><c- p>{</c-><c- k>contain</c-><c- p>:</c-> layout<c- p>}</c->
</code></pre>
      <p>In this <a data-link-type="biblio" href="#biblio-css-regions-1">[CSS-REGIONS-1]</a> example,
	content can flow from <code>#a</code> to <code>#b</code>,
	from <code>#b</code> to <code>#c</code>.
	However as <code>#c</code> is the last fragment container in the first containing box for layout containment,
	it traps all the remaining content,
	and nothing gets flowed into <code>#d</code>, <code>#e</code>, or <code>#f</code>.</p>
     </div>
    <li data-md>
     <p>If the computed value of the <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-overflow-3/#propdef-overflow" id="ref-for-propdef-overflow">overflow</a> property is
either <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-overflow-3/#valdef-overflow-visible" id="ref-for-valdef-overflow-visible">visible</a> or <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-overflow-3/#valdef-overflow-clip" id="ref-for-valdef-overflow-clip">clip</a> or a combination thereof,
any overflow must be treated as <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#ink-overflow" id="ref-for-ink-overflow">ink overflow</a>.</p>
    <li data-md>
     <p>The <a data-link-type="dfn" href="#layout-containment-containing-box" id="ref-for-layout-containment-containing-box③">containing box</a> acts as a containing block for absolutely positioned and fixed positioned descendants.</p>
    <li data-md>
     <p>The <a data-link-type="dfn" href="#layout-containment-containing-box" id="ref-for-layout-containment-containing-box④">containing box</a> creates a <a data-link-type="dfn" href="https://drafts.csswg.org/css2/visuren.html#x43" id="ref-for-x43">stacking context</a>.</p>
    <li data-md>
     <p><a data-link-type="dfn" href="https://drafts.csswg.org/css-break-3/#forced-break" id="ref-for-forced-break">Forced breaks</a> are allowed within <a data-link-type="dfn" href="#layout-containment-containing-box" id="ref-for-layout-containment-containing-box⑤">containing boxes</a> for <a data-link-type="dfn" href="#layout-containment" id="ref-for-layout-containment⑨">layout containment</a>,
but do not propagate to the parent as otherwise described in <a href="https://www.w3.org/TR/css3-break/#break-between">CSS Fragmentation 3 §3.1 Breaks Between Boxes: the break-before and break-after properties</a>.</p>
     <p class="note" role="note"><span>Note:</span> This introduces the previously non-existent possibility that <a data-link-type="dfn" href="https://drafts.csswg.org/css-break-3/#forced-break" id="ref-for-forced-break①">forced breaks</a> may occur between a box and its container (See <a href="https://www.w3.org/TR/css3-break/#possible-breaks">CSS Fragmentation 3 §4.1 Possible Break Points</a>).</p>
    <li data-md>
     <p>For the purpose of the <a class="property" data-link-type="propdesc" href="https://www.w3.org/TR/CSS2/visudet.html#propdef-vertical-align" id="ref-for-propdef-vertical-align">vertical-align</a> property,
or any other property whose effects
need to relate the position of the <a data-link-type="dfn" href="#layout-containment-containing-box" id="ref-for-layout-containment-containing-box⑥">containing box</a>'s baseline
to something other than its descendants,
the <span id="ref-for-layout-containment-containing-box⑦">containing box</span> is treated as having no baseline.</p>
   </ol>
   <p>Possible optimizations that can be enabled by <a data-link-type="dfn" href="#layout-containment" id="ref-for-layout-containment①⓪">layout containment</a> include (but are not limited to):</p>
   <ol>
    <li data-md>
     <p>When laying out the page,
the contents of separate containing boxes
can be laid out in parallel,
as they’re guaranteed not to affect each other.</p>
    <li data-md>
     <p>When laying out the page,
if the containing box is off-screen or obscured
and the layout of the visible parts of the screen do not depend on the size of the containing box
(for example, if the containing box is near the end of a block container,
and you’re viewing the beginning of the block container),
the layout of the containing box' contents can be delayed or done at a lower priority.</p>
     <p>(When paired with <a data-link-type="dfn" href="#size-containment" id="ref-for-size-containment⑦">size containment</a>,
this optimization can be applied more liberally.)</p>
   </ol>
   <h3 class="heading settled" data-level="3.3" id="containment-style"><span class="secno">3.3. </span><span class="content"> Style Containment</span><a class="self-link" href="#containment-style"></a></h3>
   <p class="note" role="note"><span>Note:</span> Style Containment is at-risk.</p>
   <p>Giving an element <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="style-containment">style containment</dfn> and has the following effects:</p>
   <ol>
    <li data-md>
     <p>The <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/generate.html#propdef-counter-increment" id="ref-for-propdef-counter-increment">counter-increment</a> and <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-lists-3/#propdef-counter-set" id="ref-for-propdef-counter-set">counter-set</a> properties
must be <a data-link-type="dfn" href="#property-scoped-to-a-sub-tree" id="ref-for-property-scoped-to-a-sub-tree">scoped to the element’s sub-tree</a> and create a new counter.</p>
    <li data-md>
     <p>The effects of the <a class="property" data-link-type="propdesc" href="https://www.w3.org/TR/CSS2/generate.html#propdef-content" id="ref-for-propdef-content">content</a> property’s <a class="css" data-link-type="maybe" href="https://www.w3.org/TR/CSS2/generate.html#value-def-open-quote" id="ref-for-value-def-open-quote">open-quote</a>, <a class="css" data-link-type="maybe" href="https://www.w3.org/TR/CSS2/generate.html#value-def-close-quote" id="ref-for-value-def-close-quote">close-quote</a>, <a class="css" data-link-type="maybe" href="https://www.w3.org/TR/CSS2/generate.html#value-def-no-open-quote" id="ref-for-value-def-no-open-quote">no-open-quote</a> and <a class="css" data-link-type="maybe" href="https://www.w3.org/TR/CSS2/generate.html#value-def-no-close-quote" id="ref-for-value-def-no-close-quote">no-close-quote</a> must be <a data-link-type="dfn" href="#property-scoped-to-a-sub-tree" id="ref-for-property-scoped-to-a-sub-tree①">scoped to the element’s sub-tree</a>.</p>
     <p class="note" role="note"><span>Note:</span> This implies that the depth of quote nesting in the subtree
is unchanged and starts at the value that its context normally implies,
but that changes to the depth of quote nesting by these values inside the subtree
do not affect the depth of quote nesting outside the subtree.</p>
   </ol>
   <p class="note" role="note"><span>Note:</span> <a data-link-type="biblio" href="#biblio-css-regions-1">[CSS-REGIONS-1]</a> has normative requirements on how <a data-link-type="dfn" href="#style-containment" id="ref-for-style-containment④">style containment</a> affects regions.</p>
   <p>A <dfn data-dfn-for="property" data-dfn-type="dfn" data-export data-lt="scoped | scoped property | scoped properties" id="property-scoped">scoped property<a class="self-link" href="#property-scoped"></a></dfn> has its effects scoped to a particular element or subtree.</p>
   <ul>
    <li data-md>
     <p>If <dfn data-dfn-for="property" data-dfn-type="dfn" data-export data-lt="scoped to an element | scoped to the element" id="property-scoped-to-an-element">scoped to an element<a class="self-link" href="#property-scoped-to-an-element"></a></dfn>,
it must act as if the scoping element was the root of the document
for the purpose of evaluating the property’s effects:
any uses of the property outside the scoping element must have no effect on the uses of the property on or in the scoping element,
and vice versa.</p>
     <p class="note" role="note"><span>Note:</span> “Scoping to an element” is currently unused.
It is defined as an extension point for future specifications to use.</p>
    <li data-md>
     <p>If <dfn class="dfn-paneled" data-dfn-for="property" data-dfn-type="dfn" data-export data-lt="scoped to a sub-tree | scoped to the sub-tree | scoped to the element’s sub-tree | scoped to an element’s sub-tree" id="property-scoped-to-a-sub-tree">scoped to a sub-tree</dfn>, it’s the same,
except the scoping element itself is counted as "outside" the tree,
like the rest of the document,
and the effects of the property on that element are unaffected by scoping.
When considering the effects of the scoped property on elements <em>inside</em> the subtree,
the element at the base of the subtree is treated as if it was the root of the document.</p>
   </ul>
   <div class="example" id="example-6932a400">
    <a class="self-link" href="#example-6932a400"></a> As <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/generate.html#propdef-counter-increment" id="ref-for-propdef-counter-increment①">counter-increment</a> is scoped to an element’s subtree,
	the first use of it within the subtree acts as if the named counter were set to 0 at the scoping element,
	regardless of whether the counter had been used outside the scoping element.
	Any increments made within the subtree have no effect on counters of the same name outside the scoping element.
	However, the <span class="css">counter()</span> and <span class="css">counters()</span> value of the <a class="property" data-link-type="propdesc" href="https://www.w3.org/TR/CSS2/generate.html#propdef-content" id="ref-for-propdef-content①">content</a> property is not itself scoped,
	and can refer to counters established outside of the subtree.
	Therefore, the following code results in <q><samp>1 1.2</samp></q> being displayed: 
<pre><code class="highlight"><c- p>&lt;</c-><c- f>div</c-><c- p>>&lt;/</c-><c- f>div</c-><c- p>></c->
</code></pre>
<pre><code class="highlight"><c- f>div </c-><c- p>{</c->
  <c- k>contain</c-><c- p>:</c-> style<c- p>;</c->
  <c- k>counter-increment</c-><c- p>:</c-> n<c- p>;</c->
<c- p>}</c->
<c- f>div::before, div::after </c-><c- p>{</c->
  <c- k>content</c-><c- p>:</c-> <c- nf>counters</c-><c- p>(</c->n<c- p>,</c-> <c- s>'.'</c-><c- p>)</c-> <c- s>" "</c-><c- p>;</c->
<c- p>}</c->
<c- f>div::after </c-><c- p>{</c->
  <c- k>counter-increment</c-><c- p>:</c-> n <c- m>2</c-><c- p>;</c->
<c- p>}</c->
</code></pre>
   </div>
   <p>Possible optimizations that can be enabled by <a data-link-type="dfn" href="#style-containment" id="ref-for-style-containment⑤">style containment</a> include (but are not limited to):</p>
   <ol>
    <li data-md>
     <p>Whenever a property is changed on a descendant of an element with <a data-link-type="dfn" href="#style-containment" id="ref-for-style-containment⑥">style containment</a>,
calculating what part of the DOM tree is "dirtied" and might need to have its style recalculated
can stop at the containing box.</p>
   </ol>
   <h3 class="heading settled" data-level="3.4" id="containment-paint"><span class="secno">3.4. </span><span class="content"> Paint Containment</span><a class="self-link" href="#containment-paint"></a></h3>
   <p>If the element does not generate a <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#principal-box" id="ref-for-principal-box⑤">principal box</a> (as is the case with <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-display-3/#propdef-display" id="ref-for-propdef-display③">display</a> values of <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-display-3/#valdef-display-contents" id="ref-for-valdef-display-contents①">contents</a> or <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-display-3/#valdef-display-none" id="ref-for-valdef-display-none①">none</a>),
	or its <span id="ref-for-principal-box⑥">principal box</span> is an <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#internal-table-box" id="ref-for-internal-table-box②">internal table box</a> other than <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-display-3/#valdef-display-table-cell" id="ref-for-valdef-display-table-cell①">table-cell</a>,
	or an <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#internal-ruby-box" id="ref-for-internal-ruby-box②">internal ruby box</a>,
	or a <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#atomic-inline" id="ref-for-atomic-inline②">non-atomic</a> <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#inline-level" id="ref-for-inline-level②">inline-level</a> box,
	paint containment has no effect.
	Otherwise, giving an element <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="paint-containment">paint containment</dfn> makes its <span id="ref-for-principal-box⑦">principal box</span> a <dfn class="dfn-paneled" data-dfn-for="paint-containment" data-dfn-type="dfn" data-noexport id="paint-containment-containing-box">containing box</dfn> for <a data-link-type="dfn" href="#paint-containment" id="ref-for-paint-containment①">paint containment</a> and has the following effects:</p>
   <ol>
    <li data-md>
     <p>The contents of the element
including both the paint of the descendants and their geometry
must be clipped to the <a data-link-type="dfn" href="https://www.w3.org/TR/CSS2/box.html#padding-edge" id="ref-for-padding-edge">padding edge</a> of the <a data-link-type="dfn" href="#paint-containment-containing-box" id="ref-for-paint-containment-containing-box">containing box</a>,
taking <a data-link-type="dfn" href="https://drafts.csswg.org/css-backgrounds-3/#corner-clipping" id="ref-for-corner-clipping">corner clipping</a> into account.
This does not include the creation of any mechanism
to access or indicate the presence of the clipped content;
nor does it inhibit the creation of any such mechanism through other properties, <span class="informative">such as <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-overflow-3/#propdef-overflow" id="ref-for-propdef-overflow①">overflow</a>, <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-ui-4/#propdef-resize" id="ref-for-propdef-resize">resize</a>, or <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-ui-3/#propdef-text-overflow" id="ref-for-propdef-text-overflow">text-overflow</a></span>. <span class="note">This is as if <a class="css" data-link-type="propdesc" href="https://drafts.csswg.org/css-overflow-3/#propdef-overflow" id="ref-for-propdef-overflow②">overflow: visible</a> was changed to <span class="css" id="ref-for-propdef-overflow③">overflow: clip</span> at used value.</span></p>
    <li data-md>
     <p>The <a data-link-type="dfn" href="#paint-containment-containing-box" id="ref-for-paint-containment-containing-box①">containing box</a> acts as a containing block for absolutely positioned and fixed positioned descendants.</p>
    <li data-md>
     <p>The <a data-link-type="dfn" href="#paint-containment-containing-box" id="ref-for-paint-containment-containing-box②">containing box</a> creates a <a data-link-type="dfn" href="https://drafts.csswg.org/css2/visuren.html#x43" id="ref-for-x43①">stacking context</a>.</p>
    <li data-md>
     <p>The <a data-link-type="dfn" href="#paint-containment-containing-box" id="ref-for-paint-containment-containing-box③">containing box</a> <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#establish-an-independent-formatting-context" id="ref-for-establish-an-independent-formatting-context①">establishes an independent formatting context</a>.</p>
   </ol>
   <div class="informative">
     Possible optimizations that can be enabled by <a data-link-type="dfn" href="#paint-containment" id="ref-for-paint-containment②">paint containment</a> include (but are not limited to): 
    <ol>
     <li data-md>
      <p>If the containing box is off-screen or obscured,
the UA can directly skip trying to paint its contents,
as they’re guaranteed to be off-screen/obscured as well.</p>
     <li data-md>
      <p>Unless the clipped content is made accessible via a separate mechanism
such as the <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-overflow-3/#propdef-overflow" id="ref-for-propdef-overflow④">overflow</a>, <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-ui-4/#propdef-resize" id="ref-for-propdef-resize①">resize</a>, or <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-ui-3/#propdef-text-overflow" id="ref-for-propdef-text-overflow①">text-overflow</a> properties,
the UA can reserve "canvas" space for the box exactly the box’s size.
(In similar, scrollable, situations, like <span class="css" id="ref-for-propdef-overflow⑤">overflow: hidden</span>,
it’s possible to scroll to the currently-clipped content,
so UAs often predictively overpaint somewhat
so there’s something to see as soon as the scroll happens,
rather than a frame later.)</p>
     <li data-md>
      <p>Because they are guaranteed to be stacking contexts,
scrolling elements can be painted into a single GPU layer.</p>
    </ol>
   </div>
   <h2 class="heading settled" data-level="4" id="privsec"><span class="secno">4. </span><span class="content">Privacy and Security Considerations</span><a class="self-link" href="#privsec"></a></h2>
   <p>This specification introduces no new privacy or security considerations.</p>
   <p>Like any other CSS specification, it affects the rendering of the document,
but does not introduce any special ability to present content in a misleading way
that was not previously available through other CSS modules
and that isn’t inherent to the act of formatting the document.</p>
   <p>The <a href="http://www.w3.org/2001/tag/">TAG</a> has developed a <a href="https://www.w3.org/TR/security-privacy-questionnaire/">self-review questionnaire</a> to help editors and Working Groups evaluate the risks introduced by their specifications.
Answers are provided below.</p>
   <dl>
    <dt>Does this specification deal with personally-identifiable information? 
    <dd>No. 
    <dt>Does this specification deal with high-value data? 
    <dd>No. 
    <dt>Does this specification introduce new state for an origin that persists across browsing sessions? 
    <dd>No. 
    <dt>Does this specification expose persistent, cross-origin state to the web? 
    <dd>No. 
    <dt>Does this specification expose any other data to an origin that it doesn’t currently have access to? 
    <dd>No. 
    <dt>Does this specification enable new script execution/loading mechanisms? 
    <dd>No. 
    <dt>Does this specification allow an origin access to a user’s location? 
    <dd>No. 
    <dt>Does this specification allow an origin access to sensors on a user’s device? 
    <dd>No. 
    <dt>Does this specification allow an origin access to aspects of a user’s local computing environment? 
    <dd>No. 
    <dt>Does this specification allow an origin access to other devices? 
    <dd>No. 
    <dt>Does this specification allow an origin some measure of control over a user agent’s native UI? 
    <dd>No. 
    <dt>Does this specification expose temporary identifiers to the web? 
    <dd>No. 
    <dt>Does this specification distinguish between behavior in first-party and third-party contexts? 
    <dd>No. 
    <dt>How should this specification work in the context of a user agent’s "incognito" mode? 
    <dd>No difference in behavior is needed. 
    <dt>Does this specification persist data to a user’s local device? 
    <dd>No. 
    <dt>Does this specification have a "Security Considerations" and "Privacy Considerations" section? 
    <dd>Yes, this is the section you are currently reading. 
    <dt>Does this specification allow downgrading default security characteristics? 
    <dd>No. 
   </dl>
   <h2 class="no-num non-normative heading settled" id="changes"><span class="content">Appendix A. Changes</span><a class="self-link" href="#changes"></a></h2>
   <p>This appendix is <em>informative</em>.</p>
   <h3 class="heading settled" id="l1-changes"><span class="content"> Changes from <a href="https://www.w3.org/TR/css-contain-1/">CSS Containment Level 1</a> </span><a class="self-link" href="#l1-changes"></a></h3>
   <ul>
    <li data-md>
     <p>Restored <a data-link-type="dfn" href="#style-containment" id="ref-for-style-containment⑦">style containment</a>, which had been dropped from Level 1</p>
   </ul>
  </main>
  <h2 class="no-ref no-num heading settled" id="conformance"><span class="content"> Conformance</span><a class="self-link" href="#conformance"></a></h2>
  <h3 class="heading settled" id="document-conventions"><span class="content"> Document conventions</span><a class="self-link" href="#document-conventions"></a></h3>
  <p>Conformance requirements are expressed with a combination of
	descriptive assertions and RFC 2119 terminology. The key words “MUST”,
	“MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”,
	“RECOMMENDED”, “MAY”, and “OPTIONAL” in the normative parts of this
	document are to be interpreted as described in RFC 2119.
	However, for readability, these words do not appear in all uppercase
	letters in this specification. </p>
  <p>All of the text of this specification is normative except sections
	explicitly marked as non-normative, examples, and notes. <a data-link-type="biblio" href="#biblio-rfc2119">[RFC2119]</a> </p>
  <p>Examples in this specification are introduced with the words “for example”
	or are set apart from the normative text with <code>class="example"</code>,
	like this: </p>
  <div class="example" id="example-ae2b6bc0">
   <a class="self-link" href="#example-ae2b6bc0"></a> 
   <p>This is an example of an informative example. </p>
  </div>
  <p>Informative notes begin with the word “Note” and are set apart from the
	normative text with <code>class="note"</code>, like this: </p>
  <p class="note" role="note">Note, this is an informative note. </p>
  <p>Advisements are normative sections styled to evoke special attention and are
	set apart from other normative text with <code>&lt;strong class="advisement"></code>, like
	this: <strong class="advisement"> UAs MUST provide an accessible alternative. </strong> </p>
  <h3 class="heading settled" id="conform-classes"><span class="content"> Conformance classes</span><a class="self-link" href="#conform-classes"></a></h3>
  <p>Conformance to this specification
	is defined for three conformance classes: </p>
  <dl>
   <dt>style sheet 
   <dd>A <a href="http://www.w3.org/TR/CSS2/conform.html#style-sheet">CSS
			style sheet</a>. 
   <dt>renderer 
   <dd>A <a href="http://www.w3.org/TR/CSS2/conform.html#user-agent">UA</a> that interprets the semantics of a style sheet and renders
			documents that use them. 
   <dt>authoring tool 
   <dd>A <a href="http://www.w3.org/TR/CSS2/conform.html#user-agent">UA</a> that writes a style sheet. 
  </dl>
  <p>A style sheet is conformant to this specification
	if all of its statements that use syntax defined in this module are valid
	according to the generic CSS grammar and the individual grammars of each
	feature defined in this module. </p>
  <p>A renderer is conformant to this specification
	if, in addition to interpreting the style sheet as defined by the
	appropriate specifications, it supports all the features defined
	by this specification by parsing them correctly
	and rendering the document accordingly. However, the inability of a
	UA to correctly render a document due to limitations of the device
	does not make the UA non-conformant. (For example, a UA is not
	required to render color on a monochrome monitor.) </p>
  <p>An authoring tool is conformant to this specification
	if it writes style sheets that are syntactically correct according to the
	generic CSS grammar and the individual grammars of each feature in
	this module, and meet all other conformance requirements of style sheets
	as described in this module. </p>
  <h3 class="heading settled" id="conform-responsible"><span class="content"> Requirements for Responsible Implementation of CSS</span><a class="self-link" href="#conform-responsible"></a></h3>
  <p>The following sections define several conformance requirements
		for implementing CSS responsibly,
		in a way that promotes interoperability in the present and future. </p>
  <h4 class="heading settled" id="conform-partial"><span class="content"> Partial Implementations</span><a class="self-link" href="#conform-partial"></a></h4>
  <p>So that authors can exploit the forward-compatible parsing rules to assign fallback values, <strong>CSS renderers <em>must</em> treat as invalid
		(and <a href="http://www.w3.org/TR/CSS2/conform.html#ignore">ignore as appropriate</a>)
		any at-rules, properties, property values, keywords, and other syntactic constructs
		for which they have no usable level of support</strong>.
		In particular, user agents <em>must not</em> selectively ignore
		unsupported property values and honor supported values in a single multi-value property declaration:
		if any value is considered invalid (as unsupported values must be),
		CSS requires that the entire declaration be ignored. </p>
  <h4 class="heading settled" id="conform-future-proofing"><span class="content"> Implementations of Unstable and Proprietary Features</span><a class="self-link" href="#conform-future-proofing"></a></h4>
  <p>To avoid clashes with future stable CSS features,
		the CSSWG recommends <a href="http://www.w3.org/TR/CSS/#future-proofing">following best practices</a> for the implementation of <a href="http://www.w3.org/TR/CSS/#unstable">unstable</a> features and <a href="http://www.w3.org/TR/CSS/#proprietary-extension">proprietary extensions</a> to CSS. </p>
  <h4 class="heading settled" id="conform-testing"><span class="content"> Implementations of CR-level Features</span><a class="self-link" href="#conform-testing"></a></h4>
  <p>Once a specification reaches the Candidate Recommendation stage,
		implementers should release an <a data-link-type="dfn" href="http://www.w3.org/TR/CSS/#vendor-prefix">unprefixed</a> implementation
		of any CR-level feature they can demonstrate
		to be correctly implemented according to spec,
		and should avoid exposing a prefixed variant of that feature. </p>
  <p>To establish and maintain the interoperability of CSS across
		implementations, the CSS Working Group requests that non-experimental
		CSS renderers submit an implementation report (and, if necessary, the
		testcases used for that implementation report) to the W3C before
		releasing an unprefixed implementation of any CSS features. Testcases
		submitted to W3C are subject to review and correction by the CSS
		Working Group. </p>
  <p>
   Further information on submitting testcases and implementation reports
		can be found from on the CSS Working Group’s website at <a href="http://www.w3.org/Style/CSS/Test/">http://www.w3.org/Style/CSS/Test/</a>.
		Questions should be directed to the <a href="http://lists.w3.org/Archives/Public/public-css-testsuite">public-css-testsuite@w3.org</a> mailing list. 
<script src="https://www.w3.org/scripts/TR/2016/fixup.js"></script>
  </p>
  <h2 class="no-num no-ref heading settled" id="index"><span class="content">Index</span><a class="self-link" href="#index"></a></h2>
  <h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="content">Terms defined by this specification</span><a class="self-link" href="#index-defined-here"></a></h3>
  <ul class="index">
   <li><a href="#propdef-contain">contain</a><span>, in §2</span>
   <li>
    containing box
    <ul>
     <li><a href="#layout-containment-containing-box">dfn for layout-containment</a><span>, in §3.2</span>
     <li><a href="#paint-containment-containing-box">dfn for paint-containment</a><span>, in §3.4</span>
     <li><a href="#size-containment-containing-box">dfn for size-containment</a><span>, in §3.1</span>
    </ul>
   <li><a href="#containment">containment</a><span>, in §3</span>
   <li><a href="#valdef-contain-content">content</a><span>, in §2</span>
   <li><a href="#valdef-contain-layout">layout</a><span>, in §2</span>
   <li><a href="#layout-containment">layout containment</a><span>, in §3.2</span>
   <li><a href="#valdef-contain-none">none</a><span>, in §2</span>
   <li><a href="#valdef-contain-paint">paint</a><span>, in §2</span>
   <li><a href="#paint-containment">paint containment</a><span>, in §3.4</span>
   <li><a href="#property-scoped">scoped</a><span>, in §3.3</span>
   <li><a href="#property-scoped">scoped properties</a><span>, in §3.3</span>
   <li><a href="#property-scoped">scoped property</a><span>, in §3.3</span>
   <li><a href="#property-scoped-to-an-element">scoped to an element</a><span>, in §3.3</span>
   <li><a href="#property-scoped-to-a-sub-tree">scoped to an element’s sub-tree</a><span>, in §3.3</span>
   <li><a href="#property-scoped-to-a-sub-tree">scoped to a sub-tree</a><span>, in §3.3</span>
   <li><a href="#property-scoped-to-an-element">scoped to the element</a><span>, in §3.3</span>
   <li><a href="#property-scoped-to-a-sub-tree">scoped to the element’s sub-tree</a><span>, in §3.3</span>
   <li><a href="#property-scoped-to-a-sub-tree">scoped to the sub-tree</a><span>, in §3.3</span>
   <li><a href="#valdef-contain-size">size</a><span>, in §2</span>
   <li><a href="#size-containment">size containment</a><span>, in §3.1</span>
   <li><a href="#valdef-contain-strict">strict</a><span>, in §2</span>
   <li><a href="#valdef-contain-style">style</a><span>, in §2</span>
   <li><a href="#style-containment">style containment</a><span>, in §3.3</span>
  </ul>
  <aside class="dfn-panel" data-for="term-for-corner-clipping">
   <a href="https://drafts.csswg.org/css-backgrounds-3/#corner-clipping">https://drafts.csswg.org/css-backgrounds-3/#corner-clipping</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-corner-clipping">3.4. 
Paint Containment</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-forced-break">
   <a href="https://drafts.csswg.org/css-break-3/#forced-break">https://drafts.csswg.org/css-break-3/#forced-break</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-forced-break">3.2. 
Layout Containment</a> <a href="#ref-for-forced-break①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-fragmentation">
   <a href="https://drafts.csswg.org/css-break-3/#fragmentation">https://drafts.csswg.org/css-break-3/#fragmentation</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-fragmentation">3.2. 
Layout Containment</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-fragmentation-container">
   <a href="https://drafts.csswg.org/css-break-3/#fragmentation-container">https://drafts.csswg.org/css-break-3/#fragmentation-container</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-fragmentation-container">3.2. 
Layout Containment</a> <a href="#ref-for-fragmentation-container①">(2)</a> <a href="#ref-for-fragmentation-container②">(3)</a> <a href="#ref-for-fragmentation-container③">(4)</a> <a href="#ref-for-fragmentation-container④">(5)</a> <a href="#ref-for-fragmentation-container⑤">(6)</a> <a href="#ref-for-fragmentation-container⑥">(7)</a> <a href="#ref-for-fragmentation-container⑦">(8)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-fragmentation-context">
   <a href="https://drafts.csswg.org/css-break-3/#fragmentation-context">https://drafts.csswg.org/css-break-3/#fragmentation-context</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-fragmentation-context">3.2. 
Layout Containment</a> <a href="#ref-for-fragmentation-context①">(2)</a> <a href="#ref-for-fragmentation-context②">(3)</a> <a href="#ref-for-fragmentation-context③">(4)</a> <a href="#ref-for-fragmentation-context④">(5)</a> <a href="#ref-for-fragmentation-context⑤">(6)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-fragmented-flow">
   <a href="https://drafts.csswg.org/css-break-3/#fragmented-flow">https://drafts.csswg.org/css-break-3/#fragmented-flow</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-fragmented-flow">3.2. 
Layout Containment</a> <a href="#ref-for-fragmented-flow①">(2)</a> <a href="#ref-for-fragmented-flow②">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-monolithic">
   <a href="https://drafts.csswg.org/css-break-3/#monolithic">https://drafts.csswg.org/css-break-3/#monolithic</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-monolithic">3.1. 
Size Containment</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-atomic-inline">
   <a href="https://drafts.csswg.org/css-display-3/#atomic-inline">https://drafts.csswg.org/css-display-3/#atomic-inline</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-atomic-inline">3.1. 
Size Containment</a>
    <li><a href="#ref-for-atomic-inline①">3.2. 
Layout Containment</a>
    <li><a href="#ref-for-atomic-inline②">3.4. 
Paint Containment</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-valdef-display-contents">
   <a href="https://drafts.csswg.org/css-display-3/#valdef-display-contents">https://drafts.csswg.org/css-display-3/#valdef-display-contents</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-valdef-display-contents">3.2. 
Layout Containment</a>
    <li><a href="#ref-for-valdef-display-contents①">3.4. 
Paint Containment</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-propdef-display">
   <a href="https://drafts.csswg.org/css-display-3/#propdef-display">https://drafts.csswg.org/css-display-3/#propdef-display</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-display">3.1. 
Size Containment</a> <a href="#ref-for-propdef-display①">(2)</a>
    <li><a href="#ref-for-propdef-display②">3.2. 
Layout Containment</a>
    <li><a href="#ref-for-propdef-display③">3.4. 
Paint Containment</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-establish-an-independent-formatting-context">
   <a href="https://drafts.csswg.org/css-display-3/#establish-an-independent-formatting-context">https://drafts.csswg.org/css-display-3/#establish-an-independent-formatting-context</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-establish-an-independent-formatting-context">3.2. 
Layout Containment</a>
    <li><a href="#ref-for-establish-an-independent-formatting-context①">3.4. 
Paint Containment</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-inline-level">
   <a href="https://drafts.csswg.org/css-display-3/#inline-level">https://drafts.csswg.org/css-display-3/#inline-level</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-inline-level">3.1. 
Size Containment</a>
    <li><a href="#ref-for-inline-level①">3.2. 
Layout Containment</a>
    <li><a href="#ref-for-inline-level②">3.4. 
Paint Containment</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-inner-display-type">
   <a href="https://drafts.csswg.org/css-display-3/#inner-display-type">https://drafts.csswg.org/css-display-3/#inner-display-type</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-inner-display-type">3.1. 
Size Containment</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-internal-ruby-box">
   <a href="https://drafts.csswg.org/css-display-3/#internal-ruby-box">https://drafts.csswg.org/css-display-3/#internal-ruby-box</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-internal-ruby-box">3.1. 
Size Containment</a>
    <li><a href="#ref-for-internal-ruby-box①">3.2. 
Layout Containment</a>
    <li><a href="#ref-for-internal-ruby-box②">3.4. 
Paint Containment</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-internal-table-box">
   <a href="https://drafts.csswg.org/css-display-3/#internal-table-box">https://drafts.csswg.org/css-display-3/#internal-table-box</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-internal-table-box">3.1. 
Size Containment</a>
    <li><a href="#ref-for-internal-table-box①">3.2. 
Layout Containment</a>
    <li><a href="#ref-for-internal-table-box②">3.4. 
Paint Containment</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-valdef-display-none">
   <a href="https://drafts.csswg.org/css-display-3/#valdef-display-none">https://drafts.csswg.org/css-display-3/#valdef-display-none</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-valdef-display-none">3.2. 
Layout Containment</a>
    <li><a href="#ref-for-valdef-display-none①">3.4. 
Paint Containment</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-principal-box">
   <a href="https://drafts.csswg.org/css-display-3/#principal-box">https://drafts.csswg.org/css-display-3/#principal-box</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-principal-box">3.1. 
Size Containment</a> <a href="#ref-for-principal-box①">(2)</a>
    <li><a href="#ref-for-principal-box②">3.2. 
Layout Containment</a> <a href="#ref-for-principal-box③">(2)</a> <a href="#ref-for-principal-box④">(3)</a>
    <li><a href="#ref-for-principal-box⑤">3.4. 
Paint Containment</a> <a href="#ref-for-principal-box⑥">(2)</a> <a href="#ref-for-principal-box⑦">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-replaced-element">
   <a href="https://drafts.csswg.org/css-display-3/#replaced-element">https://drafts.csswg.org/css-display-3/#replaced-element</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-replaced-element">3.1. 
Size Containment</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-valdef-display-table">
   <a href="https://drafts.csswg.org/css-display-3/#valdef-display-table">https://drafts.csswg.org/css-display-3/#valdef-display-table</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-valdef-display-table">3.1. 
Size Containment</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-valdef-display-table-cell">
   <a href="https://drafts.csswg.org/css-display-3/#valdef-display-table-cell">https://drafts.csswg.org/css-display-3/#valdef-display-table-cell</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-valdef-display-table-cell">3.2. 
Layout Containment</a>
    <li><a href="#ref-for-valdef-display-table-cell①">3.4. 
Paint Containment</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-propdef-grid">
   <a href="https://drafts.csswg.org/css-grid-1/#propdef-grid">https://drafts.csswg.org/css-grid-1/#propdef-grid</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-grid">3.1. 
Size Containment</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-propdef-counter-set">
   <a href="https://drafts.csswg.org/css-lists-3/#propdef-counter-set">https://drafts.csswg.org/css-lists-3/#propdef-counter-set</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-counter-set">3.3. 
Style Containment</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-propdef-columns">
   <a href="https://drafts.csswg.org/css-multicol-1/#propdef-columns">https://drafts.csswg.org/css-multicol-1/#propdef-columns</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-columns">3.1. 
Size Containment</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-valdef-overflow-clip">
   <a href="https://drafts.csswg.org/css-overflow-3/#valdef-overflow-clip">https://drafts.csswg.org/css-overflow-3/#valdef-overflow-clip</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-valdef-overflow-clip">3.2. 
Layout Containment</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-ink-overflow">
   <a href="https://drafts.csswg.org/css-overflow-3/#ink-overflow">https://drafts.csswg.org/css-overflow-3/#ink-overflow</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-ink-overflow">3.2. 
Layout Containment</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-propdef-overflow">
   <a href="https://drafts.csswg.org/css-overflow-3/#propdef-overflow">https://drafts.csswg.org/css-overflow-3/#propdef-overflow</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-overflow">3.2. 
Layout Containment</a>
    <li><a href="#ref-for-propdef-overflow①">3.4. 
Paint Containment</a> <a href="#ref-for-propdef-overflow②">(2)</a> <a href="#ref-for-propdef-overflow③">(3)</a> <a href="#ref-for-propdef-overflow④">(4)</a> <a href="#ref-for-propdef-overflow⑤">(5)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-valdef-overflow-visible">
   <a href="https://drafts.csswg.org/css-overflow-3/#valdef-overflow-visible">https://drafts.csswg.org/css-overflow-3/#valdef-overflow-visible</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-valdef-overflow-visible">3.2. 
Layout Containment</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-selectordef-nth-fragment">
   <a href="https://drafts.csswg.org/css-overflow-4/#selectordef-nth-fragment">https://drafts.csswg.org/css-overflow-4/#selectordef-nth-fragment</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-selectordef-nth-fragment">3.2. 
Layout Containment</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-valdef-width-auto">
   <a href="https://drafts.csswg.org/css-sizing-3/#valdef-width-auto">https://drafts.csswg.org/css-sizing-3/#valdef-width-auto</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-valdef-width-auto">3.1. 
Size Containment</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-sizing-property">
   <a href="https://drafts.csswg.org/css-sizing-3/#sizing-property">https://drafts.csswg.org/css-sizing-3/#sizing-property</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-sizing-property">3.1. 
Size Containment</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-propdef-text-overflow">
   <a href="https://drafts.csswg.org/css-ui-3/#propdef-text-overflow">https://drafts.csswg.org/css-ui-3/#propdef-text-overflow</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-text-overflow">3.4. 
Paint Containment</a> <a href="#ref-for-propdef-text-overflow①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-propdef-resize">
   <a href="https://drafts.csswg.org/css-ui-4/#propdef-resize">https://drafts.csswg.org/css-ui-4/#propdef-resize</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-resize">3.4. 
Paint Containment</a> <a href="#ref-for-propdef-resize①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-css-wide-keywords">
   <a href="https://drafts.csswg.org/css-values-4/#css-wide-keywords">https://drafts.csswg.org/css-values-4/#css-wide-keywords</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-css-wide-keywords">1.2. 
Values</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-comb-one">
   <a href="https://drafts.csswg.org/css-values-4/#comb-one">https://drafts.csswg.org/css-values-4/#comb-one</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-comb-one">2. 
Strong Containment: the contain property</a> <a href="#ref-for-comb-one①">(2)</a> <a href="#ref-for-comb-one②">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-comb-any">
   <a href="https://drafts.csswg.org/css-values-4/#comb-any">https://drafts.csswg.org/css-values-4/#comb-any</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-comb-any">2. 
Strong Containment: the contain property</a> <a href="#ref-for-comb-any①">(2)</a> <a href="#ref-for-comb-any②">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-value-def-close-quote">
   <a href="https://www.w3.org/TR/CSS2/generate.html#value-def-close-quote">https://www.w3.org/TR/CSS2/generate.html#value-def-close-quote</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-value-def-close-quote">3.3. 
Style Containment</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-propdef-content">
   <a href="https://www.w3.org/TR/CSS2/generate.html#propdef-content">https://www.w3.org/TR/CSS2/generate.html#propdef-content</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-content">3.3. 
Style Containment</a> <a href="#ref-for-propdef-content①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-propdef-counter-increment">
   <a href="https://drafts.csswg.org/css2/generate.html#propdef-counter-increment">https://drafts.csswg.org/css2/generate.html#propdef-counter-increment</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-counter-increment">3.3. 
Style Containment</a> <a href="#ref-for-propdef-counter-increment①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-propdef-height">
   <a href="https://drafts.csswg.org/css2/visudet.html#propdef-height">https://drafts.csswg.org/css2/visudet.html#propdef-height</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-height">3.1. 
Size Containment</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-value-def-no-close-quote">
   <a href="https://www.w3.org/TR/CSS2/generate.html#value-def-no-close-quote">https://www.w3.org/TR/CSS2/generate.html#value-def-no-close-quote</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-value-def-no-close-quote">3.3. 
Style Containment</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-value-def-no-open-quote">
   <a href="https://www.w3.org/TR/CSS2/generate.html#value-def-no-open-quote">https://www.w3.org/TR/CSS2/generate.html#value-def-no-open-quote</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-value-def-no-open-quote">3.3. 
Style Containment</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-value-def-open-quote">
   <a href="https://www.w3.org/TR/CSS2/generate.html#value-def-open-quote">https://www.w3.org/TR/CSS2/generate.html#value-def-open-quote</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-value-def-open-quote">3.3. 
Style Containment</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-padding-edge">
   <a href="https://www.w3.org/TR/CSS2/box.html#padding-edge">https://www.w3.org/TR/CSS2/box.html#padding-edge</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-padding-edge">3.4. 
Paint Containment</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-x43">
   <a href="https://drafts.csswg.org/css2/visuren.html#x43">https://drafts.csswg.org/css2/visuren.html#x43</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-x43">3.2. 
Layout Containment</a>
    <li><a href="#ref-for-x43①">3.4. 
Paint Containment</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-propdef-vertical-align">
   <a href="https://www.w3.org/TR/CSS2/visudet.html#propdef-vertical-align">https://www.w3.org/TR/CSS2/visudet.html#propdef-vertical-align</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-vertical-align">3.2. 
Layout Containment</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-propdef-width">
   <a href="https://drafts.csswg.org/css2/visudet.html#propdef-width">https://drafts.csswg.org/css2/visudet.html#propdef-width</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-width">3.1. 
Size Containment</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-elementdef-svg">
   <a href="https://svgwg.org/svg2-draft/struct.html#elementdef-svg">https://svgwg.org/svg2-draft/struct.html#elementdef-svg</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-elementdef-svg">2. 
Strong Containment: the contain property</a>
   </ul>
  </aside>
  <h3 class="no-num no-ref heading settled" id="index-defined-elsewhere"><span class="content">Terms defined by reference</span><a class="self-link" href="#index-defined-elsewhere"></a></h3>
  <ul class="index">
   <li>
    <a data-link-type="biblio">[css-backgrounds-3]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-corner-clipping" style="color:initial">corner clipping</span>
    </ul>
   <li>
    <a data-link-type="biblio">[css-break-3]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-forced-break" style="color:initial">forced break</span>
     <li><span class="dfn-paneled" id="term-for-fragmentation" style="color:initial">fragmentation</span>
     <li><span class="dfn-paneled" id="term-for-fragmentation-container" style="color:initial">fragmentation container</span>
     <li><span class="dfn-paneled" id="term-for-fragmentation-context" style="color:initial">fragmentation context</span>
     <li><span class="dfn-paneled" id="term-for-fragmented-flow" style="color:initial">fragmented flow</span>
     <li><span class="dfn-paneled" id="term-for-monolithic" style="color:initial">monolithic</span>
    </ul>
   <li>
    <a data-link-type="biblio">[css-display-3]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-atomic-inline" style="color:initial">atomic inline</span>
     <li><span class="dfn-paneled" id="term-for-valdef-display-contents" style="color:initial">contents</span>
     <li><span class="dfn-paneled" id="term-for-propdef-display" style="color:initial">display</span>
     <li><span class="dfn-paneled" id="term-for-establish-an-independent-formatting-context" style="color:initial">establishes an independent formatting context</span>
     <li><span class="dfn-paneled" id="term-for-inline-level" style="color:initial">inline-level</span>
     <li><span class="dfn-paneled" id="term-for-inner-display-type" style="color:initial">inner display type</span>
     <li><span class="dfn-paneled" id="term-for-internal-ruby-box" style="color:initial">internal ruby box</span>
     <li><span class="dfn-paneled" id="term-for-internal-table-box" style="color:initial">internal table box</span>
     <li><span class="dfn-paneled" id="term-for-valdef-display-none" style="color:initial">none</span>
     <li><span class="dfn-paneled" id="term-for-principal-box" style="color:initial">principal box</span>
     <li><span class="dfn-paneled" id="term-for-replaced-element" style="color:initial">replaced element</span>
     <li><span class="dfn-paneled" id="term-for-valdef-display-table" style="color:initial">table</span>
     <li><span class="dfn-paneled" id="term-for-valdef-display-table-cell" style="color:initial">table-cell</span>
    </ul>
   <li>
    <a data-link-type="biblio">[css-grid-1]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-propdef-grid" style="color:initial">grid</span>
    </ul>
   <li>
    <a data-link-type="biblio">[css-lists-3]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-propdef-counter-set" style="color:initial">counter-set</span>
    </ul>
   <li>
    <a data-link-type="biblio">[CSS-MULTICOL-1]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-propdef-columns" style="color:initial">columns</span>
    </ul>
   <li>
    <a data-link-type="biblio">[css-overflow-3]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-valdef-overflow-clip" style="color:initial">clip</span>
     <li><span class="dfn-paneled" id="term-for-ink-overflow" style="color:initial">ink overflow</span>
     <li><span class="dfn-paneled" id="term-for-propdef-overflow" style="color:initial">overflow</span>
     <li><span class="dfn-paneled" id="term-for-valdef-overflow-visible" style="color:initial">visible</span>
    </ul>
   <li>
    <a data-link-type="biblio">[css-overflow-4]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-selectordef-nth-fragment" style="color:initial">::nth-fragment()</span>
    </ul>
   <li>
    <a data-link-type="biblio">[css-sizing-3]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-valdef-width-auto" style="color:initial">auto</span>
     <li><span class="dfn-paneled" id="term-for-sizing-property" style="color:initial">sizing property</span>
    </ul>
   <li>
    <a data-link-type="biblio">[css-ui-3]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-propdef-text-overflow" style="color:initial">text-overflow</span>
    </ul>
   <li>
    <a data-link-type="biblio">[css-ui-4]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-propdef-resize" style="color:initial">resize</span>
    </ul>
   <li>
    <a data-link-type="biblio">[css-values-4]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-css-wide-keywords" style="color:initial">css-wide keywords</span>
     <li><span class="dfn-paneled" id="term-for-comb-one" style="color:initial">|</span>
     <li><span class="dfn-paneled" id="term-for-comb-any" style="color:initial">||</span>
    </ul>
   <li>
    <a data-link-type="biblio">[CSS2]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-value-def-close-quote" style="color:initial">close-quote</span>
     <li><span class="dfn-paneled" id="term-for-propdef-content" style="color:initial">content</span>
     <li><span class="dfn-paneled" id="term-for-propdef-counter-increment" style="color:initial">counter-increment</span>
     <li><span class="dfn-paneled" id="term-for-propdef-height" style="color:initial">height</span>
     <li><span class="dfn-paneled" id="term-for-value-def-no-close-quote" style="color:initial">no-close-quote</span>
     <li><span class="dfn-paneled" id="term-for-value-def-no-open-quote" style="color:initial">no-open-quote</span>
     <li><span class="dfn-paneled" id="term-for-value-def-open-quote" style="color:initial">open-quote</span>
     <li><span class="dfn-paneled" id="term-for-padding-edge" style="color:initial">padding edge</span>
     <li><span class="dfn-paneled" id="term-for-x43" style="color:initial">stacking context</span>
     <li><span class="dfn-paneled" id="term-for-propdef-vertical-align" style="color:initial">vertical-align</span>
     <li><span class="dfn-paneled" id="term-for-propdef-width" style="color:initial">width</span>
    </ul>
   <li>
    <a data-link-type="biblio">[SVG2]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-elementdef-svg" style="color:initial">svg</span>
    </ul>
  </ul>
  <h2 class="no-num no-ref heading settled" id="references"><span class="content">References</span><a class="self-link" href="#references"></a></h2>
  <h3 class="no-num no-ref heading settled" id="normative"><span class="content">Normative References</span><a class="self-link" href="#normative"></a></h3>
  <dl>
   <dt id="biblio-css-backgrounds-3">[CSS-BACKGROUNDS-3]
   <dd>Bert Bos; Elika Etemad; Brad Kemper. <a href="https://www.w3.org/TR/css-backgrounds-3/">CSS Backgrounds and Borders Module Level 3</a>. 17 October 2017. CR. URL: <a href="https://www.w3.org/TR/css-backgrounds-3/">https://www.w3.org/TR/css-backgrounds-3/</a>
   <dt id="biblio-css-break-3">[CSS-BREAK-3]
   <dd>Rossen Atanassov; Elika Etemad. <a href="https://www.w3.org/TR/css-break-3/">CSS Fragmentation Module Level 3</a>. 4 December 2018. CR. URL: <a href="https://www.w3.org/TR/css-break-3/">https://www.w3.org/TR/css-break-3/</a>
   <dt id="biblio-css-contain-1">[CSS-CONTAIN-1]
   <dd>Tab Atkins Jr.; Florian Rivoal. <a href="https://www.w3.org/TR/css-contain-1/">CSS Containment Module Level 1</a>. 30 April 2019. CR. URL: <a href="https://www.w3.org/TR/css-contain-1/">https://www.w3.org/TR/css-contain-1/</a>
   <dt id="biblio-css-display-3">[CSS-DISPLAY-3]
   <dd>Tab Atkins Jr.; Elika Etemad. <a href="https://www.w3.org/TR/css-display-3/">CSS Display Module Level 3</a>. 28 August 2018. CR. URL: <a href="https://www.w3.org/TR/css-display-3/">https://www.w3.org/TR/css-display-3/</a>
   <dt id="biblio-css-lists-3">[CSS-LISTS-3]
   <dd>Elika Etemad; Tab Atkins Jr.. <a href="https://www.w3.org/TR/css-lists-3/">CSS Lists Module Level 3</a>. 25 April 2019. WD. URL: <a href="https://www.w3.org/TR/css-lists-3/">https://www.w3.org/TR/css-lists-3/</a>
   <dt id="biblio-css-overflow-3">[CSS-OVERFLOW-3]
   <dd>David Baron; Elika Etemad; Florian Rivoal. <a href="https://www.w3.org/TR/css-overflow-3/">CSS Overflow Module Level 3</a>. 31 July 2018. WD. URL: <a href="https://www.w3.org/TR/css-overflow-3/">https://www.w3.org/TR/css-overflow-3/</a>
   <dt id="biblio-css-values-3">[CSS-VALUES-3]
   <dd>Tab Atkins Jr.; Elika Etemad. <a href="https://www.w3.org/TR/css-values-3/">CSS Values and Units Module Level 3</a>. 31 January 2019. CR. URL: <a href="https://www.w3.org/TR/css-values-3/">https://www.w3.org/TR/css-values-3/</a>
   <dt id="biblio-css-values-4">[CSS-VALUES-4]
   <dd>Tab Atkins Jr.; Elika Etemad. <a href="https://www.w3.org/TR/css-values-4/">CSS Values and Units Module Level 4</a>. 31 January 2019. WD. URL: <a href="https://www.w3.org/TR/css-values-4/">https://www.w3.org/TR/css-values-4/</a>
   <dt id="biblio-css2">[CSS2]
   <dd>Bert Bos; et al. <a href="https://www.w3.org/TR/CSS2/">Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification</a>. 7 June 2011. REC. URL: <a href="https://www.w3.org/TR/CSS2/">https://www.w3.org/TR/CSS2/</a>
   <dt id="biblio-rfc2119">[RFC2119]
   <dd>S. Bradner. <a href="https://tools.ietf.org/html/rfc2119">Key words for use in RFCs to Indicate Requirement Levels</a>. March 1997. Best Current Practice. URL: <a href="https://tools.ietf.org/html/rfc2119">https://tools.ietf.org/html/rfc2119</a>
   <dt id="biblio-svg2">[SVG2]
   <dd>Amelia Bellamy-Royds; et al. <a href="https://www.w3.org/TR/SVG2/">Scalable Vector Graphics (SVG) 2</a>. 4 October 2018. CR. URL: <a href="https://www.w3.org/TR/SVG2/">https://www.w3.org/TR/SVG2/</a>
  </dl>
  <h3 class="no-num no-ref heading settled" id="informative"><span class="content">Informative References</span><a class="self-link" href="#informative"></a></h3>
  <dl>
   <dt id="biblio-css-grid-1">[CSS-GRID-1]
   <dd>Tab Atkins Jr.; Elika Etemad; Rossen Atanassov. <a href="https://www.w3.org/TR/css-grid-1/">CSS Grid Layout Module Level 1</a>. 14 December 2017. CR. URL: <a href="https://www.w3.org/TR/css-grid-1/">https://www.w3.org/TR/css-grid-1/</a>
   <dt id="biblio-css-multicol-1">[CSS-MULTICOL-1]
   <dd>Florian Rivoal; Rachel Andrew. <a href="https://www.w3.org/TR/css-multicol-1/">CSS Multi-column Layout Module Level 1</a>. 28 May 2018. WD. URL: <a href="https://www.w3.org/TR/css-multicol-1/">https://www.w3.org/TR/css-multicol-1/</a>
   <dt id="biblio-css-overflow-4">[CSS-OVERFLOW-4]
   <dd>David Baron; Florian Rivoal. <a href="https://www.w3.org/TR/css-overflow-4/">CSS Overflow Module Level 4</a>. 13 June 2017. WD. URL: <a href="https://www.w3.org/TR/css-overflow-4/">https://www.w3.org/TR/css-overflow-4/</a>
   <dt id="biblio-css-page-3">[CSS-PAGE-3]
   <dd>Elika Etemad; Simon Sapin. <a href="https://www.w3.org/TR/css-page-3/">CSS Paged Media Module Level 3</a>. 18 October 2018. WD. URL: <a href="https://www.w3.org/TR/css-page-3/">https://www.w3.org/TR/css-page-3/</a>
   <dt id="biblio-css-regions-1">[CSS-REGIONS-1]
   <dd>Rossen Atanassov; Alan Stearns. <a href="https://www.w3.org/TR/css-regions-1/">CSS Regions Module Level 1</a>. 9 October 2014. WD. URL: <a href="https://www.w3.org/TR/css-regions-1/">https://www.w3.org/TR/css-regions-1/</a>
   <dt id="biblio-css-sizing-3">[CSS-SIZING-3]
   <dd>Tab Atkins Jr.; Elika Etemad. <a href="https://www.w3.org/TR/css-sizing-3/">CSS Intrinsic &amp; Extrinsic Sizing Module Level 3</a>. 22 May 2019. WD. URL: <a href="https://www.w3.org/TR/css-sizing-3/">https://www.w3.org/TR/css-sizing-3/</a>
   <dt id="biblio-css-ui-3">[CSS-UI-3]
   <dd>Tantek Çelik; Florian Rivoal. <a href="https://www.w3.org/TR/css-ui-3/">CSS Basic User Interface Module Level 3 (CSS3 UI)</a>. 21 June 2018. REC. URL: <a href="https://www.w3.org/TR/css-ui-3/">https://www.w3.org/TR/css-ui-3/</a>
   <dt id="biblio-css-ui-4">[CSS-UI-4]
   <dd>Florian Rivoal. <a href="https://www.w3.org/TR/css-ui-4/">CSS Basic User Interface Module Level 4</a>. 22 December 2017. WD. URL: <a href="https://www.w3.org/TR/css-ui-4/">https://www.w3.org/TR/css-ui-4/</a>
  </dl>
  <h2 class="no-num no-ref heading settled" id="property-index"><span class="content">Property Index</span><a class="self-link" href="#property-index"></a></h2>
  <div class="big-element-wrapper">
   <table class="index">
    <thead>
     <tr>
      <th scope="col">Name
      <th scope="col">Value
      <th scope="col">Initial
      <th scope="col">Applies to
      <th scope="col">Inh.
      <th scope="col">%ages
      <th scope="col">Anim­ation type
      <th scope="col">Canonical order
      <th scope="col">Com­puted value
    <tbody>
     <tr>
      <th scope="row"><a class="css" data-link-type="property" href="#propdef-contain" id="ref-for-propdef-contain①⑤">contain</a>
      <td>none | strict | content | [ size || layout || style || paint ]
      <td>none
      <td>See below
      <td>no
      <td>n/a
      <td>not animatable
      <td>per grammar
      <td>specified keyword(s)
   </table>
  </div>
  <aside class="dfn-panel" data-for="propdef-contain">
   <b><a href="#propdef-contain">#propdef-contain</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-contain②">1. 
Introduction</a>
    <li><a href="#ref-for-propdef-contain③">2. 
Strong Containment: the contain property</a> <a href="#ref-for-propdef-contain④">(2)</a> <a href="#ref-for-propdef-contain⑤">(3)</a> <a href="#ref-for-propdef-contain⑥">(4)</a> <a href="#ref-for-propdef-contain⑦">(5)</a> <a href="#ref-for-propdef-contain⑧">(6)</a> <a href="#ref-for-propdef-contain⑨">(7)</a> <a href="#ref-for-propdef-contain①⓪">(8)</a> <a href="#ref-for-propdef-contain①①">(9)</a> <a href="#ref-for-propdef-contain①②">(10)</a> <a href="#ref-for-propdef-contain①③">(11)</a> <a href="#ref-for-propdef-contain①④">(12)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="containment">
   <b><a href="#containment">#containment</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-containment">2. 
Strong Containment: the contain property</a> <a href="#ref-for-containment①">(2)</a>
    <li><a href="#ref-for-containment②">3. 
Types of Containment</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="size-containment">
   <b><a href="#size-containment">#size-containment</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-size-containment">2. 
Strong Containment: the contain property</a> <a href="#ref-for-size-containment①">(2)</a> <a href="#ref-for-size-containment②">(3)</a>
    <li><a href="#ref-for-size-containment③">3.1. 
Size Containment</a> <a href="#ref-for-size-containment④">(2)</a> <a href="#ref-for-size-containment⑤">(3)</a> <a href="#ref-for-size-containment⑥">(4)</a>
    <li><a href="#ref-for-size-containment⑦">3.2. 
Layout Containment</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="size-containment-containing-box">
   <b><a href="#size-containment-containing-box">#size-containment-containing-box</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-size-containment-containing-box">3.1. 
Size Containment</a> <a href="#ref-for-size-containment-containing-box①">(2)</a> <a href="#ref-for-size-containment-containing-box②">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="layout-containment">
   <b><a href="#layout-containment">#layout-containment</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-layout-containment">2. 
Strong Containment: the contain property</a>
    <li><a href="#ref-for-layout-containment①">3.1. 
Size Containment</a> <a href="#ref-for-layout-containment②">(2)</a>
    <li><a href="#ref-for-layout-containment③">3.2. 
Layout Containment</a> <a href="#ref-for-layout-containment④">(2)</a> <a href="#ref-for-layout-containment⑤">(3)</a> <a href="#ref-for-layout-containment⑥">(4)</a> <a href="#ref-for-layout-containment⑦">(5)</a> <a href="#ref-for-layout-containment⑧">(6)</a> <a href="#ref-for-layout-containment⑨">(7)</a> <a href="#ref-for-layout-containment①⓪">(8)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="layout-containment-containing-box">
   <b><a href="#layout-containment-containing-box">#layout-containment-containing-box</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-layout-containment-containing-box">3.2. 
Layout Containment</a> <a href="#ref-for-layout-containment-containing-box①">(2)</a> <a href="#ref-for-layout-containment-containing-box②">(3)</a> <a href="#ref-for-layout-containment-containing-box③">(4)</a> <a href="#ref-for-layout-containment-containing-box④">(5)</a> <a href="#ref-for-layout-containment-containing-box⑤">(6)</a> <a href="#ref-for-layout-containment-containing-box⑥">(7)</a> <a href="#ref-for-layout-containment-containing-box⑦">(8)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="style-containment">
   <b><a href="#style-containment">#style-containment</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-style-containment①">2. 
Strong Containment: the contain property</a> <a href="#ref-for-style-containment②">(2)</a> <a href="#ref-for-style-containment③">(3)</a>
    <li><a href="#ref-for-style-containment④">3.3. 
Style Containment</a> <a href="#ref-for-style-containment⑤">(2)</a> <a href="#ref-for-style-containment⑥">(3)</a>
    <li><a href="#ref-for-style-containment⑦"> Changes from CSS Containment Level 1 </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="property-scoped-to-a-sub-tree">
   <b><a href="#property-scoped-to-a-sub-tree">#property-scoped-to-a-sub-tree</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-property-scoped-to-a-sub-tree">3.3. 
Style Containment</a> <a href="#ref-for-property-scoped-to-a-sub-tree①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="paint-containment">
   <b><a href="#paint-containment">#paint-containment</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-paint-containment">2. 
Strong Containment: the contain property</a>
    <li><a href="#ref-for-paint-containment①">3.4. 
Paint Containment</a> <a href="#ref-for-paint-containment②">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="paint-containment-containing-box">
   <b><a href="#paint-containment-containing-box">#paint-containment-containing-box</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-paint-containment-containing-box">3.4. 
Paint Containment</a> <a href="#ref-for-paint-containment-containing-box①">(2)</a> <a href="#ref-for-paint-containment-containing-box②">(3)</a> <a href="#ref-for-paint-containment-containing-box③">(4)</a>
   </ul>
  </aside>
<script>/* script-dfn-panel */

document.body.addEventListener("click", function(e) {
    var queryAll = function(sel) { return [].slice.call(document.querySelectorAll(sel)); }
    // Find the dfn element or panel, if any, that was clicked on.
    var el = e.target;
    var target;
    var hitALink = false;
    while(el.parentElement) {
        if(el.tagName == "A") {
            // Clicking on a link in a <dfn> shouldn't summon the panel
            hitALink = true;
        }
        if(el.classList.contains("dfn-paneled")) {
            target = "dfn";
            break;
        }
        if(el.classList.contains("dfn-panel")) {
            target = "dfn-panel";
            break;
        }
        el = el.parentElement;
    }
    if(target != "dfn-panel") {
        // Turn off any currently "on" or "activated" panels.
        queryAll(".dfn-panel.on, .dfn-panel.activated").forEach(function(el){
            el.classList.remove("on");
            el.classList.remove("activated");
        });
    }
    if(target == "dfn" && !hitALink) {
        // open the panel
        var dfnPanel = document.querySelector(".dfn-panel[data-for='" + el.id + "']");
        if(dfnPanel) {
            dfnPanel.classList.add("on");
            var rect = el.getBoundingClientRect();
            dfnPanel.style.left = window.scrollX + rect.right + 5 + "px";
            dfnPanel.style.top = window.scrollY + rect.top + "px";
            var panelRect = dfnPanel.getBoundingClientRect();
            var panelWidth = panelRect.right - panelRect.left;
            if(panelRect.right > document.body.scrollWidth && (rect.left - (panelWidth + 5)) > 0) {
                // Reposition, because the panel is overflowing
                dfnPanel.style.left = window.scrollX + rect.left - (panelWidth + 5) + "px";
            }
        } else {
            console.log("Couldn't find .dfn-panel[data-for='" + el.id + "']");
        }
    } else if(target == "dfn-panel") {
        // Switch it to "activated" state, which pins it.
        el.classList.add("activated");
        el.style.left = null;
        el.style.top = null;
    }

});
</script>